0

在我的网站中,我使用 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);
            }
4

1 回答 1

1

要在 ASP.NET 服务器上使用 Process,您需要将应用程序配置为完全信任。

您确定需要生成此进程服务器端吗?看来您没有使用它的输出。

于 2012-07-07T06:50:57.623 回答