请教一个route的问题的!!(已解决)
本帖最后由 dashe 于 2009-8-28 00:11 编辑#NoTrayIcon
Dim $ip
While 1
$ip = InputBox("IP输入", "请输入访问的IP地址", "", "", "200", "100")
If @error = 1 Then Exit
If $ip = "" Then
MsgBox(0 + 16, "警告窗口", "请输入访问的IP!!!")
Else
ExitLoop
Exit
EndIf
WEnd
Run(@ComSpec & " /c route add $ip mask 255.255.255.0 10.0.0.18","",@SW_HIDE)
MsgBox(0, "提示", "已经添加进路由表了!!", 3)
Exit
达人们看一下这段代码,问题出在什么地方,路由表始终添加不进去。。谢谢了,向你们虚心学习!! 本帖最后由 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\d|25|?\d\d?)\.){3}(2\d|25|?\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') 再一次谢谢afan大哥,呵呵!!
页:
[1]