110,569
社区成员
发帖
与我相关
我的任务
分享
private void button_Click(object sender,EventArgs e)
{
Thread pingTh=null;
if(pingTh!=null)
{
try
{
pingTh.Abort();
}
catch
{
}
finally
{
pingTh=null;
}
}
pingTh=new Thread(Ping); //Ping是具体实现ping PVR的方法。用ICMP数据包实现ping。
PingTh.Start();
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
//要写的代码
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
楼主不妨把代码放到这里,试试看.