2012-07-07 46 views
0

在我的网站中,我使用System.Diagnostics.Process.Start来预览特定文件。它在本地服务器上工作正常,但是当我尝试预览该文件时,它会在联机服务器上引发ThreadAbortException。System.Diagnostics.Process.Start在服务器上抛出threadbort异常

发生的按钮点击中继器的预览。

if (e.CommandName == "Preview") 
      { 
       Button btn = (Button)e.CommandSource; 
       string filePath = Server.MapPath("~/Upload"); 
       string _DownloadableProductFileName = filename; 
       System.Diagnostics.Process.Start(filePath + "\\" + _DownloadableProductFileName); 
      } 
+0

请提供一些代码 – Narendra 2012-07-07 06:36:47

+0

同时检查IIS设置,这可能是一些权限问题。 – Narendra 2012-07-07 06:39:08

+0

@Naren请重新检查编辑代码 – user1509 2012-07-07 06:43:45

回答

1

要使用过程中,你需要configure the application for Full Trust.

ASP.NET服务器上是否确实需要生成这个过程中服务器端:下面的代码给出?看来你没有使用它的输出。

+1

我只是希望用户预览文件内容而不下载它。 – user1509 2012-07-07 07:34:40

+0

这些是什么类型的文件? – 2012-07-07 07:37:06

+0

微软办公文件:文字,演示文稿等 – user1509 2012-07-07 07:51:47