多线程让线程等待的问题。 多线程线程C# 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int index; string[] args; public void MendthCall(string[] arg, int index) { this.index = index; this.args = arg; Thread t = new Thread(exc); t.Start(); } public void exc() { List<string> list = GetSeverConfig(); RemotingServerConn conn = new RemotingServerConn(); ExecuteCOM ec = new ExecuteCOM(); string str = ""; for (int i = 0; i < list.Count; i++) { ec = conn.ServerConn(list[i]); str = IsLeisureServer(ec); } if (str != "") { ExecuteMenthod method = aa; method(ec, str); } else { } } delegate void ExecuteMenthod(ExecuteCOM s1, string s2); public void aa(ExecuteCOM ec, string str) { _ICOMcallback.OnExecuteComplete_Event += new ExecuteComplete_Event(ExecuteComplete_EventMethod); //添加回掉实例 ec.AddOnlineCallBack(_ICOMcallback); //判断传递来的数组是否存在句柄 if (index != -1) { //把获取到的任务句柄赋给这个数组 args[index] = str; object obj = new object(); //锁定修改 lock (obj) { ec.UpdateXML(str, "忙碌");//修改当前句柄为忙碌状态 } } //执行 ec.ExecuteAsyncPreAndCal(args); }我给改成这样了,每次来一个任务就新建一个线程? 额的神啊,项目经理都不会的问题,我怎么办,大侠帮忙!!! [求助]如此画线连接表格怎么实现 有关于优化程序代码 {"对象类型无法转换为目标类型。"} 一道面试题 dataset如何更新数据中的数据 一个继承自datagridview的WF控件的问题 如何获取网页中的图片文件?并显示在WinForm中 请各位大哥进来指点下,最后一个问题 请高手点评一下这个ASP.NET 论坛系统 全球首个同时支持多形象的Avatar系统 为个按钮定义快捷键F1-9 C# object类型如何转成float?
string[] args;
public void MendthCall(string[] arg, int index)
{
this.index = index;
this.args = arg;
Thread t = new Thread(exc);
t.Start();
}
public void exc()
{
List<string> list = GetSeverConfig();
RemotingServerConn conn = new RemotingServerConn();
ExecuteCOM ec = new ExecuteCOM();
string str = "";
for (int i = 0; i < list.Count; i++)
{
ec = conn.ServerConn(list[i]);
str = IsLeisureServer(ec); }
if (str != "")
{
ExecuteMenthod method = aa;
method(ec, str);
}
else
{ }
}
delegate void ExecuteMenthod(ExecuteCOM s1, string s2);
public void aa(ExecuteCOM ec, string str)
{
_ICOMcallback.OnExecuteComplete_Event += new ExecuteComplete_Event(ExecuteComplete_EventMethod);
//添加回掉实例
ec.AddOnlineCallBack(_ICOMcallback);
//判断传递来的数组是否存在句柄
if (index != -1)
{
//把获取到的任务句柄赋给这个数组
args[index] = str;
object obj = new object();
//锁定修改
lock (obj)
{
ec.UpdateXML(str, "忙碌");//修改当前句柄为忙碌状态
}
}
//执行
ec.ExecuteAsyncPreAndCal(args);
}我给改成这样了,每次来一个任务就新建一个线程?