打印机总是打到75张就停,我这里有个软件可以解决这个问题

时间:2012-06-09 11:52:23
【文件属性】:

文件名称:打印机总是打到75张就停,我这里有个软件可以解决这个问题

文件大小:48KB

文件格式:RAR

更新时间:2012-06-09 11:52:23

解决打印机打印限制页数的问题

源码:public partial class Form1 : Form { public Form1() { InitializeComponent(); this.cboPageMax.Text = GetRegistData(); this.lblMessage.Text = "你当前电脑打印最高页数为" + GetRegistData()+"页"; } private void button1_Click(object sender, EventArgs e) { this.lblMessage.Text = ""; string txtPageNumber = this.cboPageMax.Text.ToString().Trim(); foreach (char c in txtPageNumber) { if (!Char.IsNumber(c)) { lblMessage.Text = "这里只能输入数字整数"; return; } } try { Boolean boolSucsess = WTRegedit(txtPageNumber); //将打印最大页数保存到注册表里 int pageNumber = Convert.ToInt32(GetRegistData()); if (boolSucsess) { MessageBox.Show("成功将最高打印页数设置到" + pageNumber + "页"); } else { MessageBox.Show("打印最高张数还是" + pageNumber + "页,没有设置成功,权限不够,不能设置,请找网管或管理员在管理员administrator权限下设置"); } this.lblMessage.Text = "你目前电脑打印最高页数为" + GetRegistData() + "页"; } catch (Exception ex) { this.lblMessage.Text = "你电脑打印最高页数还是" + GetRegistData() + "页,没有设置成功"; MessageBox.Show("权限不够,不能设置,请找网管或管理员在高级权限下设置 " + ex); } } // Windows Registry Editor Version 5.00 //[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\InProcServer] //"PrintJobLimit"="50000" //[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\Server] //"PrintJobLimit"="50000" private string GetRegistData() //注册表读取 {//Registry string registData; RegistryKey hkml = Registry.LocalMachine; //RegistryKey software = hkml.OpenSubKey("HKEY_LOCAL_MACHINE", true); RegistryKey node1 = hkml.OpenSubKey("SOFTWARE", true); RegistryKey node2 = node1.OpenSubKey("Crystal Decisions", true); RegistryKey node3 = node2.OpenSubKey("10.2", true); RegistryKey node4 = node3.OpenSubKey("Report Application Server", true); RegistryKey node5 = node4.OpenSubKey("InProcServer", true); RegistryKey node41 = node4.OpenSubKey("Server", true); registData = node41.GetValue("PrintJobLimit").ToString().Trim(); return registData; } private Boolean WTRegedit(string tovalue) //写到注册表 { try { RegistryKey hkml = Registry.LocalMachine; RegistryKey node1 = hkml.OpenSubKey("SOFTWARE", true); RegistryKey node2 = node1.OpenSubKey("Crystal Decisions", true); RegistryKey node3 = node2.OpenSubKey("10.2", true); RegistryKey node4 = node3.OpenSubKey("Report Application Server", true); RegistryKey node5 = node4.OpenSubKey("InProcServer", true); RegistryKey node41 = node4.OpenSubKey("Server", true); node5.SetValue("PrintJobLimit", (Convert.ToInt32(tovalue.Trim())+750).ToString().Trim()); //设置[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\InProcServer] //设置"PrintJobLimit"="50000" node41.SetValue("PrintJobLimit", tovalue.Trim()); //[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\Server] //"PrintJobLimit"="50000" return true; } catch (Exception) { return false; } }


【文件预览】:
打印机打印票数突破75张的解决方法.exe

网友评论