使用ASP .NET,C#批量打印Word文件 [英] Bulk print of word file using asp .net, c#

查看:273
本文介绍了使用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();
    }
}

推荐答案

我有同样的问题,当我发布到Server 2003 IIS 6.0时,它不起作用!
I have the same problem , when I publish to server 2003 IIS 6.0 it not work !


为什么要在服务器上打印内容?您是Intranet应用程序吗?我怀疑ASP.NET用户是否可以打印这样的文件.这不是ASP.NET的工作方式.
Why on earth do you want to print things on your server ? Is yours an intranet application ? I doubt that the ASP.NET user is able to print files like this. It''s just not how ASP.NET works.


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆