本帖最后由 afan 于 2009-8-12 22:18 编辑
没研究过route,不过 至少Run格式不对~ 顺便完善了下~#NoTrayIcon
Dim $ip
While 1
$ip = InputBox("IP输入", "请输入访问的IP地址", "", "", "200", "100")
If @error = 1 Then Exit
If $ip = "" Then
MsgBox(0 + 16, "警告窗口", "请输入访问的IP!!!")
ElseIf StringRegExp($ip, "^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$", 0) = 0 Then
MsgBox(0 + 16, "警告窗口", "请输入正确格式的IP地址 ")
Else
ExitLoop
EndIf
WEnd
RunWait(@ComSpec & " /c " & "route add " & $ip & " mask 255.255.255.0 10.0.0.18", "", @SW_HIDE)
RunWait(@ComSpec & " /c " & "route print > tmp.txt", "", @SW_HIDE)
ShellExecutewait('tmp.txt')
;MsgBox(0, "提示", "已经添加进路由表了!!", 3)
FileDelete('tmp.txt')
|