private void Form_Recv_Load(object sender, EventArgs e) { //设置端口信息 Form_UdpSet setform = new Form_UdpSet(); setform.SetLocalInfo(m_udpcomm.GetIPAddress(), 7000); setform.SetRemoteInfo(m_udpcomm.GetIPAddress(), 6000); setform.ShowDialog(); //初始化通信 m_udpcomm.InitCommInstance(setform.m_strLocalIp, setform.m_nLocalPort); m_udpcomm.SetRemotePoint(setform.m_strRemoteIp, setform.m_nRemotePort); m_udpcomm.BeginReceiveData(OnUdpRecv, true); }
private void Form_SendImage_Load(object sender, EventArgs e) { //设置端口信息 Form_UdpSet setform = new Form_UdpSet(); setform.SetLocalInfo(m_imagetrans.m_udpComm.GetIPAddress(), 6000); setform.SetRemoteInfo(m_imagetrans.m_udpComm.GetIPAddress(), 7000); setform.ShowDialog(); //初始化通信 m_imagetrans.m_udpComm.InitCommInstance(setform.m_strLocalIp, setform.m_nLocalPort); m_imagetrans.m_udpComm.SetRemotePoint(setform.m_strRemoteIp, setform.m_nRemotePort); m_strTitleOld = this.Text; UpdateWindowInfo(); }