110,538
社区成员
发帖
与我相关
我的任务
分享
public class MessageEventWaitHandle<T> : EventWaitHandle
{
private T message;
public MessageEventWaitHandle(bool initialState, EventResetMode mode)
: base(initialState, mode)
{
}
public bool Set(T message)
{
this.message = message;
return base.Set();
}
public T GetMessage()
{
return this.message;
}
}
不用谢,高兴的话,赏点分!!!
public class MyParams//这里存放特定消息
{
public string IP;
}
MyParams _MyParams = new MyParams();
_MyParams.IP = "192.168.226.1";
Thread MyPing = new Thread(new ParameterizedThreadStart(CmdPing));
MyPing.IsBackground = true;
MyPing.Start(_MyParams);
private static string CmdPing(object str)
{
MyParams _theip = str as MyParams;
_theip.IP.Trim()//这里取出实际要接收的参数。
}