我有一台d-link dp-311p打印服务器,它在其接口上提供打印机状态(脱机、缺纸等)。如何获取此旧状态??我试图通过axence nettools查找,但是有很多键,描述也不友好……另外,我正在尝试使用this代码(c#)来访问打印服务器状态,但没有成功……请借个火,我完全迷路了!Tks所有人
发布于 2010-12-10 22:45:11
我做到了!方法如下:搜索mib浏览器,因为我不知道打印服务器状态的oid。找到This one,然后,我创建了一个控制台应用程序,如下所示
OLEPRNLib.SNMP snmp = new OLEPRNLib.SNMP();
int Retries = 1;
int TimeoutInMS = 2000;
string CommunityString = "public";
string IPAddressOfPrinter = "192.168.1.12";
string ALLINEED;
// Open the SNMP connect to the print server
snmp.Open(IPAddressOfPrinter, CommunityString, Retries, TimeoutInMS);
ALLINEED = snmp.Get(".1.3.6.1.4.1.11.2.3.9.1.1.3.0");
snmp.Close();
Console.Write(ALLINEED);在我的机器上,我在“添加引用”对话框的COM选项卡上引用了“oleprn1.0类型库”,它位于“c:\Windows\System32\oleprn.dll”中。
希望这能对某些人有所帮助。
Tks
https://stackoverflow.com/questions/4403029
复制相似问题