VB编写MAC与IP绑定问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 21:18:18
网关为192.168.1.1 MAC地址为00-18-B9-08-BB-7A
在XP系统的步骤为:运行-->cmd-->arp -d
arp -s 192.168.1.1 00-18-B9-08-BB-7A

如果我要VB编写一个form,点击就自动运行以上命令该怎么写:

Private Sub Form_Load()
Form1.Hide
?????????????????????
Unload Form1
End Sub
shell "cmd.exe /c arp -d",vbhide
shell "cmd.exe /c arp -s arp -s 192.168.1.1 00-18-B9-08-BB-7A",vbhide
中加上了 /c 请问是什么意思
第二行多了一个 arp -s

Private Sub Form_Load()
Form1.Hide
shell "cmd.exe /c arp -d",vbhide
shell "cmd.exe /c arp -s arp -s 192.168.1.1 00-18-B9-08-BB-7A",vbhide
Unload Form1
End Sub
或者:
Private Sub Form_Load()
Form1.Hide
open app.path & "\绑IP.bat" for output as #1
print #1,"arp -d"
print #1,"arp -s 192.168.1.1 00-18-B9-08-BB-7A
"
print #1,"del 绑IP.bat"
print #1,"exit"
shell app.path & "\绑IP.bat",vbhide'隐藏运行。
Unload Form1
End Sub