Discussion Locked

Retrieve a port alias from Java

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an existing port alias defined in the Winnt\System32\drivers\etc\Services file: msgconsole 15200/tcp

How can I retrieve the port number '15200' from within a Java program by using the alias of 'msgconsole'?

3 replies

by okujava

hi! from within java program u can't retrieve the port number! what u could do is, call a shell program from your java code and parse the output of it...

regards

s.okujava

This discussion is closed to new replies.