用VB.NET实现设置计算机IP地址
2008-05-18 13:52
295 查看
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 interface ip set address " + " ""本地连接"" " + " static 192.168.0.108 255.255.255.0 192.168.0.1 1")
p.St
4000
andardInput.WriteLine("netsh -c interface 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
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 interface ip set address " + " ""本地连接"" " + " static 192.168.0.108 255.255.255.0 192.168.0.1 1")
p.St
4000
andardInput.WriteLine("netsh -c interface 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
相关文章推荐
- VB.NET实现计算机关机/重启/休眠/注销
- [VB.NET]vb中很容易实现的打印机设置窗口,在vb.net中如何实现?烦恼中!
- .Net/C#/VB/T-SQL/Java 实现: 将天文数字转换成中文大写 (2000 年前的思路,打劫的,一点儿技术含量都没有)
- 在VB.NET中怎么实现多窗体同步
- 用VB.net实现对.ini文件的读写操作的类
- 开源:.NET环境下有关打印页面设置、打印机设置、打印预览对话框的实现
- vb.net的windows窗体实现dos命令
- 批处理实现固定IP地址 系统自动登录 登录后锁定计算机
- VB.NET实现DirectSound9 (6) 声音特效
- 用vb.net实现类似写字板程序的部分源代码
- 使用vb.net代码实现图像水印技术
- VB.NET面向对象的实现(七)
- VS2010-VB.NET实现wait延时处理
- 数据加载等待页面的VB.NET代码实现
- 【VB.NET】大陆与台湾计算机术语对比
- 取得本机的IP地址 (vb.net)
- 获得网卡MAC地址和IP地址(VB.net)
- VB.Net三层实现小例
- C#实现获取设置IP地址小工具