Hi guys..
Try This code to change your Local IP address.
import java.io.IOException;
import java.lang.Runtime;
public class Chang_Ip {
public static void main(String args[]) throws IOException
{
String str1="192.168.0.201";
String str2="255.255.255.0";
String[] command1 = { "netsh", "interface", "ip", "set", "address",
"name=", "Local Area Connection" ,"source=static", "addr=",str1,
"mask=", str2};
Process pp = java.lang.Runtime.getRuntime().exec(command1);
}
}
Try This code to change your Local IP address.
import java.io.IOException;
import java.lang.Runtime;
public class Chang_Ip {
public static void main(String args[]) throws IOException
{
String str1="192.168.0.201";
String str2="255.255.255.0";
String[] command1 = { "netsh", "interface", "ip", "set", "address",
"name=", "Local Area Connection" ,"source=static", "addr=",str1,
"mask=", str2};
Process pp = java.lang.Runtime.getRuntime().exec(command1);
}
}
Comments
Thanks in advance....
that of IPv4 and IPv6
Such as op:
enter a choice:
1. change IP Address
2. Change Subnet Mask
3. Change Default gateaway Address
4. Change DNS server Address
and so....
so you would have understood