2013-10-15 4 views
4

PC/노트북 IP 주소 & 서브넷 마스크를 변경할 수있는 프로그램을 만들려고합니다. 내가 만들고자하는 입력은 Windows의 IPv4 속성 (ip/subnet, dns/alternate dns)의 인터페이스와 비슷합니다.로컬 컴퓨터/이더넷 IP 주소를 변경하는 방법

내가 생각할 수있는 것들은 netsh 명령을 사용하여 windows ip를 변경하는 것입니다. 는 내가 뭘 원하는, 느릅 나무 트릭을 할해야 당신은 자바에서 레지스트리를 변경할 수 있습니다 사전

답변

6

에 창

덕분에 이더넷 설정을 설정/얻을 수 있습니다. 다음은 도움이 될 것입니다

http://www.windowsreference.com/networking/dhcp-static-ip-settings-in-windows-registry/

http://www.windowsreference.com/networking/dhcp-static-ip-settings-in-windows-registry/

다른 방법은 자바에서 netsh 명령을 호출하는 것입니다 :

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); 
0

배우자의 완벽한 예를있다. 프로그램을 관리자로 실행해야합니다.

Change IP Address in VB.Net

그러나, 나는 첫 번째 대답에 동의하지거야. 넷 구성 변경 후 PC를 다시 시작할 필요가 없습니다.

관련 문제