How to access a printer name from IP on network in C#?

前端 未结 2 1805
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-20 07:49

I can get to the printer with the name \"\\\\xxxx\\[name of printer]\" but have no idea how to access this with only the IP of the printer. Any ideas?

EDIT: The answ

2条回答
  •  爱一瞬间的悲伤
    2020-12-20 08:28

    If it has a host name it has an IP and they can be interchanged as needed.

    \\MyMachine\MyPrinter
    

    ...equates to...

    \\10.0.0.1\MyPrinter
    

    If your printer is not on a machine and is a networked printer it will have its own IP address which you can use.

    \\MyPrinter
    

    ...equates to...

    \\10.0.0.2
    

提交回复
热议问题