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

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -