How to get the ip address of a printer?
I have a network printer, how can I get the Printer Ip address from The Printer name? is there any classes or functions to do this?
Thanks.
Hi,
You can get the IPAddress by using the machine name of the Printer.
IPHostEntry hostInfo = Dns.GetHostByName("MachineName"); string strIPAdress = hostInfo.AddressList[0].ToString(); |
Regards,
Vikram
but how to get the machine name or a printer? I just know the Printer Name .
Thanks again.
In case of a network printer it may not be so. When I see in my Printer Properties I see it as : Printer01 on Server01 and I can access the printer as
\\Server01\Printer01 and the Server also has other Printers.
So, I guess you need to explicitly know the Server to which the Printer is attached.
Regards,
Vikram
I install a network printer, which port is "ne4" and the port is TCP/IP standard Port, whose ip address is 192.168.0.2, My question is how to get the Ipaddress(192.168.0.2) of the Port?
Thanks all. :)