"远程主机强迫关闭了一个现有的连接",怎样修改可以
1个回答
展开全部
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
IPEndPoint server = null;
UdpClient uc = null;
public Form1()
{
InitializeComponent();
}
Thread thread1 = null;
private void Form1_Load(object sender, EventArgs e)
{
try
{
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 1000);
IPAddress address = IPAddress.Parse("127.0.0.1");
byte[] a=new byte[]{1,11};
uc = new UdpClient();
server = new IPEndPoint(address, 1000);
uc.Send(a,a.Length,server);
thread1 = new Thread(jieshou);
thread1.Start();
}
catch
{
MessageBox.Show("sdf");
}
}
public void jieshou()
{
while (true)
{
try
{
byte[] Data = uc.Receive(ref server); //将获取的远程消息转换成二进制
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
IPEndPoint server = null;
UdpClient uc = null;
public Form1()
{
InitializeComponent();
}
Thread thread1 = null;
private void Form1_Load(object sender, EventArgs e)
{
try
{
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 1000);
IPAddress address = IPAddress.Parse("127.0.0.1");
byte[] a=new byte[]{1,11};
uc = new UdpClient();
server = new IPEndPoint(address, 1000);
uc.Send(a,a.Length,server);
thread1 = new Thread(jieshou);
thread1.Start();
}
catch
{
MessageBox.Show("sdf");
}
}
public void jieshou()
{
while (true)
{
try
{
byte[] Data = uc.Receive(ref server); //将获取的远程消息转换成二进制
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
Storm代理
2023-06-05 广告
2023-06-05 广告
StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,IP...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询