java - Need to get ip informat -


i using printservice class details of attached printer have requirement ip of attached printer.

i able names of attached printer not able ip.

printservice[] printservices =       printservicelookup.lookupprintservices(null, null);   system.out.println("number of print services: " + printservices.length);    (printservice printer : printservices)     //system.out.println("printer: " + printer.getname());      system.out.println("printer: " + printer.getname());    } 

can let me know how can ip of printer?

give inetaddress.getbyname try. can't know sure printer name in case true network/dns name if does, that'll need.

string ip = inetaddress.getbyname(printer.getname()).tostring() 

Comments

Popular posts from this blog

forms - Secure PHP File Upload Script -

c# - Regex Problems, extracting data to groups -

silverlight - SL4 - TextTrimming in DataGridRowGroupHeader -