|M| 幕白兄还是打印的那个问题,在我的asp.net程序中判断是否打印成功呢
private void btnPrint_Click(object sender, System.EventArgs e)
{
bool ISOK = false;
//MessageBox.Show(IsReOk(ref ISOK).ToString());
string msg= GetPrinterStatus(ref ISOK);
if(ISOK)
{
IsReOk(ref ISOK);
if(ISOK)
{
try
{
//this.printDocument1.DefaultPageSettings.PrinterSettings.
this.printDocument1.Print();
this.label1.Text ="打印完毕!";
MessageBox.Show("票据打印完毕,请关闭当前窗口!");
//this.printDocument1.
btnPrint.Visible = false;
}
catch(Exception ex)
{
this.label1.Text = ex.Message;
MessageBox.Show("票据打印出错,请稍后再试!","票据打印出错:");
btnPrint.Visible = true;
}
}
else
{
MessageBox.Show("记录打印出错,请稍后再试!","票据打印出错:");
}
}
else
{
MessageBox.Show(msg,"打印机连接问题:");
}
}