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 -

java - where to store the user credentials in an enterprise application(EAI)? -

openxml - Programmatically format a date in an excel sheet using Office Open Xml SDK -