locked
How to get the ip address of a printer?

    Question

  • Hi all,
       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.
    Friday, July 15, 2005 2:35 AM

Answers

  • Hi,

    You can get the IPAddress by using the machine name of the Printer.


    IPHostEntry hostInfo = Dns.GetHostByName("MachineName");
    string strIPAdress = hostInfo.Addre­ssList[0].ToString();

     

    Regards,
    Vikram

     

    Friday, July 15, 2005 4:39 AM

All replies

  • Hi,

    You can get the IPAddress by using the machine name of the Printer.


    IPHostEntry hostInfo = Dns.GetHostByName("MachineName");
    string strIPAdress = hostInfo.Addre­ssList[0].ToString();

     

    Regards,
    Vikram

     

    Friday, July 15, 2005 4:39 AM
  • hi Vikram,
    Thanks for you reply,

    but how to get the machine name or a printer? I just know the Printer Name .

    Thanks again.

    • Proposed as answer by Sunny Anand Friday, September 11, 2009 12:30 PM
    Friday, July 15, 2005 4:55 AM
  • I think it's the same as the computer's name, is it not?
    • Proposed as answer by Sunny Anand Friday, September 11, 2009 12:30 PM
    Saturday, July 16, 2005 12:47 PM
  • Hi,

    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
    • Proposed as answer by Sunny Anand Friday, September 11, 2009 12:30 PM
    Saturday, July 16, 2005 1:12 PM
  • Hi, thanks for your reply, but the question is get the Printer's IP address, not the ip address of the host which printer installed on.

    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. :)
    • Proposed as answer by Sunny Anand Friday, September 11, 2009 12:30 PM
    Wednesday, July 20, 2005 7:44 AM