내가 만든 나는 이것이 쓰기를 시도하고vb.net 응용 프로그램에서 시각적 기본 스크립트를 작성하십시오. 내 응용 프로그램에서
Dim strIPAddress
Dim strSubnetMask
Dim strGateway
Dim intGatewayMetric
Dim strDns1
Dim strDns2
strIPAddress = "192.168.1.211"
strSubnetMask = "255.255.255.0"
strGateway = "192.168.0.11"
intGatewayMetric = 1
strDns1 = "8.8.8.8"
strDns2 = "4.4.4.4"
Set objShell = WScript.CreateObject("Wscript.Shell")
objShell.Run "netsh interface ip set address name=""Local Area Connection"" static " & strIPAddress & " " & strSubnetMask & " " & strGateway & " " & intGatewayMetric, 0, True
objShell.Run "netsh interface ip set dns name=""Local Area Connection"" static "& strDns1, 0, True
objShell.Run "netsh interface ip add dns name=""Local Area Connection"" addr="& strDns2, 0, True
Set objShell = Nothing
WScript.Quit
방법 ... 그것은 IP 주소
스크립트는 다음과 같다을 변경하는 Visual Basic 스크립트를 작성해야 다음과 같은 ..
Directory.CreateDirectory("C:\SpecMee\IPChanger\")
Dim objwriter As New System.IO.StreamWriter("C:\SpecMee\IPChanger\IpChanger.vbs")
objwriter.WriteLine("Dim strIPAddress" & Environment.NewLine & "Dim strSubnetMask" & Environment.NewLine & "Dim strGateWay" & Environment.NewLine & "Dim intGatewayMetric" & Environment.NewLine & "Dim strDns1" & Environment.NewLine & "Dim strDns2" & Environment.NewLine & "strIPAddress = """ & Environment.NewLine & TB_IPAddress & Environment.NewLine &)
objwriter.Close()
MessageBox.Show("Created")
오전 데 문제는 내가 스크립트에서 ""포함 할 것입니다 방법, 연령과 두 복용, 하나입니다.
나는 이것에 시간을 보내고 싶지 않다. 나는 이것이 올바른 방향으로 가고 있는지 잘 모른다.
어떤 도움을 주시면 감사하겠습니다. 연속
감사 크리스
는 왜해야합니까 "스크립트"라는 프로그래밍 방식으로 작성 하시겠습니까? –
사용자가 스크립트 내에서 IP 주소를 변경할 수있게해야 응용 프로그램 내부에 쓸 필요가 있기 때문에 스크립트를 쓸 때 유용합니다. – user1244772
스티브, 조언 주셔서 감사합니다. Diidnt 내가 할 수있는 것을 안다. 감사 – user1244772