日期:2014-05-17 浏览次数:21266 次
using mshtml;
HTMLWindow2 html = null;
CmdControl cmd = null;
Thread work = null;
string JsName = string.Empty;
public class1()
{
cmd = new CmdControl();
cmd.EvtResult += new DltResultCallBack(CallBack);
}
public void GetInfo(object obj, string jsname)
{
work = new Thread(new ThreadStart(() =>
{
html = (HTMLWindow2)obj;
JsName = jsname;
cmd.GetUserInfo(out hr);
}));
work.Start();
}
//这里得到多线程处理后的结果
private void CallBack(string result)
{
if (html != null)
{
string a = string.Format("{0}('{1}')", JsName, result);
html.execScript(a, "javascript");
}
}