1.定义一个线程调用的方法函数

private void RTPServer(object _Serverip)
{
IPEndPoint Serverip = _Serverip as IPEndPoint;

}

2.Thread _ReceiveThread ;//创建一个线程实例

3.调用函数

private void button4_Click(object sender, EventArgs e)
{
IPAddress ipaddress = IPAddress.Parse(txtIP.Text);
IPEndPoint ip = new IPEndPoint(ipaddress, 12006);

_ReceiveThread = new Thread(new ThreadStart(delegate { RTPServer(ip); }));
_ReceiveThread.IsBackground = true;
_ReceiveThread.Priority = ThreadPriority.AboveNormal;
_ReceiveThread.Start();

}

 

相关文章:

  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
相关资源
相似解决方案