编程语言 程序设计交流站


Join the forum, it's quick and easy

编程语言 程序设计交流站
编程语言 程序设计交流站
Would you like to react to this message? Create an account in a few clicks or log in to continue.
编程语言 程序设计交流站

欢迎关顾本站,在这里你可以畅所欲言,提出你要解决的问题,各路高手会给你一个圆满的答复,另外有各种源代码、源程序等供你下载。vb vc c++ c# delphi 易语言 Java PASCAL VFP JS VBS Pascal SQL...>


您没有登录。 请登录注册

用VB.NET实现设置计算机IP地址

向下  留言 [第1页/共1页]

斑竹2012


天才程序员
天才程序员

Private Sub Button_Click()
Dim p As New Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardInput = True
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.RedirectStandardError = True
p.StartInfo.CreateNoWindow = True
p.Start()
p.StandardInput.WriteLine("netsh inte***ce ip set address " + " ""本地连接"" " + " static 192.168.0.108 255.255.255.0 192.168.0.1 1")
p.StandardInput.WriteLine("netsh -c inte***ce ip set dns name=" + " ""本地连接"" " + " source=static addr=220.189.127.107 register=PRIMARY")
p.StandardInput.WriteLine("exit")
Dim strMessage As String = p.StandardOutput.ReadToEnd()
If (strMessage.IndexOf("确定") <> -1) Then
MessageBox.Show("填写ip成功!")
Else
MessageBox.Show("填写ip失败!!")
End If
p.Close()
End Sub

返回页首  留言 [第1页/共1页]

您在这个论坛的权限:
不能在这个论坛回复主题