C#开发的activex,用户控件做的。在用户控件中启动一新线程,新线程一执行WEB窗口就全关闭了。请问该怎么在activex中使用线程?
C#开发的activex,用户控件做的。在用户控件中启动一新线程,新线程一执行WEB窗口就全关闭了。请问该怎么在activex中使用线程?javascript如下:
function UploadFile(ctrlid0, ctrlid1, ctrlid2)
{
var localPath = document.getElementById(ctrlid0).value;
var length = localPath.length;
if (length > 0)
{
var serverPath = document.getElementById(ctrlid1).value + "\\" + document.getElementById(ctrlid2).value;
activex.PutNewEx(localPath, serverPath);
__doPostBack('lnkUploadPostBack','');
}
}
activex函数如下:
public void PutNewEx(string strFileName, string strRemoteName)
{
publicStrFileName = strFileName;
publicStrRemoteName = strRemoteName;
//on initialise le thread
m_listeningThread = new Thread(new ThreadStart(PutNew));
m_listeningThread.IsBackground = true;
m_listeningThread.Start();
}