Documente Academic
Documente Profesional
Documente Cultură
Code:
Notes:
a. “while” loop has been used in order to print multiple lines of the command
output until there is null line (empty).
b. The output of the “Process” is in byte format and when “BufferedReader”
reads the output, it must be in string or character format. Then,
“InputStreamReader” class converts it.
c. “getInputStream” function is getting the data in byte format.
d. The most common “cmd” commands that you can use on windows are as
follow:
1. ping + ip or domain
Test the ability of one network host to communicate with another.
2. tracert + ip or domain
Examine the path to a remote host. It works similar to ping but the
difference is sending a series of ICMP echo request and the TTL increased
by 1 each time. Allow to display the routes through which packets are
passing. In each hop it sends 3 packets of data and measures the time.
3. ipconfig or ipconfig /all
Display basic IP address configuration information for the device such as
IP, subnet mask , default gateway, and etc. you will have to use /all if you
want to see DNS server information that the windows is configured to use.
References:
https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html
https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html
https://docs.oracle.com/javase/7/docs/api/java/io/BufferedReader.html
https://docs.oracle.com/javase/7/docs/api/java/io/InputStreamReader.html
http://support.seagate.com/rightnow/Flash/central_axis/IPCommands.pdf
https://help.fasthosts.co.uk/app/answers/detail/a_id/1550/kw/traceroute