我再试试#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\..\..\图标\3919\3919\28.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <FTPEx.au3>
Sleep(10000)
Local $server = '10.1.56.101' ;服务器0
Local $server1 = '10.1.56.220' ;服务器1
Select
Case p($server) = 1
$name = 'run' ;用户名
$pass = 'admin' ;密码
$Open = _FTP_Open('MyFTP') ;打开一个FTP会话
$Conn = _FTP_Connect($Open,$server,$name,$pass,0,21) ;连接到ftp服务器
$ftp_download = _FTP_FileGet($Conn,"\run.exe",@TempDir&"\run.exe",False) ;下载文件(True=覆盖 False=不覆盖(默认))
;~ MsgBox(0,"下载",$Ftp_download)
If $Ftp_download = 0 Then MsgBox(0,"错误","FTP文件下载失败")
$Ftpc = _FTP_Close($Open) ;关闭 _FTP_Open 打开的回话
Sleep(1000)
Run(@TempDir&"\run.exe")
Case p($server1) = 1
$name = 'run' ;用户名
$pass = 'admin' ;密码
$Open = _FTP_Open('MyFTP') ;打开一个FTP会话
$Conn = _FTP_Connect($Open,$server1,$name,$pass,0,21) ;连接到ftp服务器
$ftp_download = _FTP_FileGet($Conn,"\run.exe",@TempDir&"\run.exe",False) ;下载文件(True=覆盖 False=不覆盖(默认))
;~ MsgBox(0,"下载",$Ftp_download)
If $Ftp_download = 0 Then MsgBox(0,"错误","FTP文件下载失败")
$Ftpc = _FTP_Close($Open) ;关闭 _FTP_Open 打开的回话
Sleep(1000)
Run(@TempDir&"\run.exe")
EndSelect
Func p($server);检测PIng是否通
Local $var = Ping($server, 250)
If $var Then; 还可以: If @error = 0 Then ...
;~ MsgBox(0,"状态-成功","收发时间间隔:" & $var & "毫秒")
Return 1
Else
;~ MsgBox(0,"状态-失败","错误代码:" & @error)
Return 0
EndIf
Case Else
MsgBox(0,"run网络未发现","您若看到这条信息请将其忽略,此信息对用户无意义请无向网管中心询问。")
EndFunc
|