解决方法
在indy 9中,有一个单元IdStack,与TIdStack类
fStack := TIdStack.CreateStack; try edit.caption := fStack.LocalAddress; //the first address i believe ComboBox1.Items.Assign(fStack.LocalAddresses); //all the address' finally freeandnil(fStack); end;
工作很好:)
来自雷米Lebeau的评论
The same exists in Indy 10,but the
code is a little different:
TIdStack.IncUsage; try GStack.AddLocalAddressesToList(ComboBox1.Items); Edit.Caption := ComboBox1.Items[0]; finally TIdStack.DecUsage; end;