Я получил такое сообщение:
Код: Выделить всё
An unhandled exception of type 'System.ObjectDisposedException' occurred in System.dll
Additional information: Cannot access a disposed object.

Я работаю с формой vs 2013 и C#...< /p>
Это мой простой код:
Код: Выделить всё
private void btnConnect_Click(object sender, EventArgs e)
{
Result = socketComponent.tcpConnect(Host, int.Parse(Port));
if (Result == 0)
MessageBox.Show("Connected");
}
private void btnDisconnect_Click(object sender, EventArgs e)
{
if (socketComponent != null)
{
socketComponent.tcpDisconnect();
socketComponent.Dispose();
MessageBox.Show("DisConnected");
}
}
Подробнее здесь: https://stackoverflow.com/questions/253 ... ed-in-syst