Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
:)
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 --

C#
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();
    }
}
Posted
Updated 8-Jul-10 23:24pm
v3
Comments
Prosanta Kundu online 9-Jul-10 4:48am    
Reason for my vote of 1
Bad approach to print a word document in the server side in ASP.Net.

I have the same problem , when I publish to server 2003 IIS 6.0 it not work !
 
Share this answer
 
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.
 
Share this answer
 
Comments
yogeshu 9-Jul-10 4:38am    
Reason for my vote of 1
I ask about the solution, and this not the solution.
yogeshu 9-Jul-10 4:39am    
this is not the solution......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900