请问一个c#中的打印问题

yangbc yangbc 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
想请问一个c#中的打印问题,下面是我写的一段打印一个文件的代码,你看看这样写支持网络打印么,我用网络上的打印机,结果打出来的是空白页面,怎么解决?
private void button1_Click(object sender, System.EventArgs e)
{
printDialog1=new PrintDialog();
printDialog1.AllowPrintToFile =false;
PrintDocument docPrn = new PrintDocument();
docPrn.DocumentName="t1.txt";
printDialog1.Document=docPrn;
if(printDialog1.ShowDialog()==DialogResult.OK)
{
try
{
docPrn.Print();
}
catch
{
MessageBox.Show ("Error While Printing", "Print Error");
}
}
}
...全文

相关推荐

评论 17
收藏 已收藏
分享
返回顶部
yangbc
C# 111,129 成员 642,538 内容