本文介绍了使用ASP .NET,C#批量打印Word文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:)


我想从我的asp .net应用程序中打印批量Word文件,该代码在我的本地计算机上可以正常工作,但是发布后,当我在另一台计算机上运行该应用程序时,会出现处理错误.

Thead被中止了.

以下是我使用的代码-

:)
Hi,

I want to print bulk word file from my asp .net application, the code working fine on my local machine, but after publishing, when i run that application on other machine , it gets error of thearding.

Thead was aborted.

Following is the code i have used --

if (Directory.Exists(strRptPath))
{
   DirectoryInfo dI = new DirectoryInfo(strRptPath);
   FileInfo[] rgFiles = dI.GetFiles("*.doc");
   foreach (FileInfo fi in rgFiles)
   {
      Process MyProcess = new Process();
      MyProcess.StartInfo.CreateNoWindow = false;
      MyProcess.StartInfo.Verb = "print";
      MyProcess.StartInfo.FileName = dI.FullName + "\\" + fi.Name;
      MyProcess.Start();
      MyProcess.WaitForExit(10000);
      MyProcess.Close();
    }
}

推荐答案



这篇关于使用ASP .NET,C#批量打印Word文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 00:49