开发者

I want PDF file print into network print

I want PDF file print into network print Following code where used, it work fine in local host (development area) but not worked in IIS serve host Can given to any rights issue? How t开发者_Go百科o solve the issue ?

private void SendToPrinter()    
{        
ProcessStartInfo info = new ProcessStartInfo(); 
info.Verb = "print";    
info.FileName = @"c:\output.pdf";  
info.CreateNoWindow = true; 
info.WindowStyle = ProcessWindowStyle.Hidden;    
Process p = new Process();    
p.StartInfo = info;  
p.Start();       
p.WaitForInputIdle();      
System.Threading.Thread.Sleep(3000);    
if (false == p.CloseMainWindow())        
p.Kill(); 
} 


It might be an authorization/security problem. IIS (the server) runs in a context which doesn't have access to the shared printer. Your local host has it cause it's running in your user's context.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜