C#を使用してネットワーク内のリモートシステムに接続しようとしています。次に、プログラムは次の例外をスローします
ターゲットマシンが積極的に拒否したため、接続できませんでした192.168.1.42:8000
private void Start_Sending_Video_Conference(string remote_IP,int port_number)
{
try
{
ms = new MemoryStream();// Store it in Binary Array as
pictureBox1.Image.Save(ms,System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] arrImage = ms.GetBuffer();
myclient = new TcpClient (remote_IP,port_number);//Connecting with server
myns = myclient.GetStream ();
mysw = new BinaryWriter (myns);
mysw.Write(arrImage);//send the stream to above address
ms.Flush();
mysw.Flush();
myns.Flush();
ms.Close();
mysw.Close ();
myns.Close ();
myclient.Close ();
}
catch (Exception ex)
{
Capturing.Enabled = false;
MessageBox.Show(ex.Message, "Video Conference Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}