在 C# 中确定打印机的 IP 地址 [英] Determine the IP Address of a Printer in C#

查看:56
本文介绍了在 C# 中确定打印机的 IP 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 C# (.NET 2.0) 确定打印机的 IP 地址.我只有在 Windows 操作系统上设置的打印机共享名称,格式为 \PC NamePrinter Name.打印机是网络打印机,与 PC 有不同的 IP 地址.有大佬指点一下吗?

I would like to determine the IP address of a printer, using C# (.NET 2.0). I have only the printer share name as set up on the Windows OS, in the format \PC NamePrinter Name. The printer is a network printer, and has a different IP address to the PC. Does anyone have any pointers?

预先感谢您的帮助.

问候安迪.

推荐答案

检查这个问题:如何在 C#.NET 中获取打印机信息?.我认为您必须从 WMI 属性中获取属性 PortName.

Check this question: How to get Printer Info in C#.NET?. I think that you have to get the property PortName from the WMI properties.

这篇关于在 C# 中确定打印机的 IP 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆