0
我想通過FTP上傳文件,而不需要「複製」對話框,並且我希望在完成上傳文件時關閉腳本(因爲有上傳文件的睡眠時間,並且當我刪除它時代碼不會上傳文件)。如何在FTP上傳期間抑制「複製」窗口?
Set oShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
path = "kll.bat"
FTPUpload(path)
Sub FTPUpload(path)
On Error Resume Next
Const copyType = 16
waitTime = 2000
FTPUser = "username"
FTPPass = "password"
FTPHost = "ftp.example.com"
strFTP = "ftp://" & FTPUser & ":" & FTPPass & "@" & FTPHost
set objFTP = oShell.NameSpace(strFTP)
If objFSO.FileExists(path) Then
set objFile = objFSO.getFile(path)
strParent = objFile.ParentFolder
Set objFolder = oShell.NameSpace(strParent)
Set objItem = objFolder.ParseName(objFile.Name)
objFTP.CopyHere objItem, copyType
End If
If Err.Number <> 0 Then
End If
WScript.Sleep waitTime
End Sub
複製窗口的行是(objFTP.CopyHere objItem,copyType),我想讓它隱藏 – TheDrfifa 2014-12-06 09:49:52
1.)爲什麼你的代碼不縮進? 2)你確定要在網上發佈實時用戶名和密碼嗎? – Tomalak 2014-12-06 10:00:27
1)它是成功的工作,但有問題,我想有人解決它2)用戶是空的意思,如果任何機構破解它沒有一點與該 – TheDrfifa 2014-12-06 11:06:29