我有以下方法:
protected void RunWSFScript()
{
try
{
System.Diagnostics.Process scriptProc = new System.Diagnostics.Process();
scriptProc.StartInfo.FileName = @"cscript";
scriptProc.StartInfo.Arguments = "\\\\server\\folder\\script.wsf \\\\server\\folder\\"
+ file + ".xml";
scriptProc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; //prevent console window from popping up
scriptProc.Start();
scriptProc.WaitForExit();
scriptProc.Close();
string message = @"Please verify output.";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload=function(){");
sb.Append("alert('");
sb.Append(message);
sb.Append("')};");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
}
catch
{
string message = "An error has occured. Please try again.";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload=function(){");
sb.Append("alert('");
sb.Append(message);
sb.Append("')};");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
}
}
我遇到的问题是,当我在本地调试时运行该方法时脚本正确执行,但是在我将站点放在 iis 服务器上之后,它不再执行,我也没有收到任何错误。
可能是什么问题?