在我的网站中,我使用 System.Diagnostics.Process.Start 来预览特定文件。它在本地服务器上工作正常,但是当我尝试预览文件时,它会在在线服务器上抛出 ThreadAbortException。
预览发生在中继器的按钮单击上。代码如下:
if (e.CommandName == "Preview")
{
Button btn = (Button)e.CommandSource;
string filePath = Server.MapPath("~/Upload");
string _DownloadableProductFileName = filename;
System.Diagnostics.Process.Start(filePath + "\\" + _DownloadableProductFileName);
}