繁体   English   中英

“ /”应用程序中的服务器错误。 未安装打印机

[英]Server Error in '/' Application. No printers are installed

“ /”应用程序中的服务器错误。

没有安装打印机。

说明:执行当前Web请求期间发生未处理的异常。 请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

异常详细信息:System.Drawing.Printing.InvalidPrinterException:未安装任何打印机。

源错误:

Line 166:              
Line 167:               
Line 168:                    rpt.PrintToPrinter(1, false, 0, 0);
Line 169:              
Line 170:                //Response.Redirect("~/SavingsAccountReg.aspx");

源文件: d:\\inetpub\\vhosts\\atmnidhi.com\\httpdocs\\savingreport.aspx.cs行:168

堆栈跟踪:

[InvalidPrinterException: No printers are installed.]
   System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal(String printer) +199408
   System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal() +28
   System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings pageSettings) +48
   CrystalDecisions.CrystalReports.Engine.PrintOptions.CopyTo(PrinterSettings printer, PageSettings page) +322
   CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN) +176
   CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN) +73
   savingreport.btnsave_Click(Object sender, EventArgs e) in d:\inetpub\vhosts\atmnidhi.com\httpdocs\savingreport.aspx.cs:168
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9633962
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.34237

没有安装打印机。

说明:执行当前Web请求期间发生未处理的异常。 请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

异常详细信息:

System.Drawing.Printing.InvalidPrinterException:未安装打印机。

如何解决这个错误

假设您实际上打算允许Web请求使连接到服务器的打印机将某些内容打印出来

  1. 确保为服务器配置了默认打印机
  2. 确保运行Web应用程序所使用的身份具有访问打印机的权限。

请注意,如果黑客获得了对该网页的访问权限,则可能会导致您花费大量纸张和墨水/墨粉:-)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM