Excuse me INET control how to judge whether a FTP folder exist?
Time:10-06
Private Sub Command1_Click () Rc.inet1. Cancel 'to Cancel before operation Rc.inet1. URL="ftp://192.168.1.33" 'local FTP Rc.inet1. Protocol=icFTP Rc.inet1. RemoteHost="192.168.1.33" Rc.inet1. RemotePort=21 Rc.inet1. UserName="ABCD" Rc.inet1. Password="1234" Rc.inet1. Execute rc.inet1 URL, "3455" MKDIR 'to build a 3455 folder Dim RIGHT1 As Boolean RIGHT1=rc.inet1. StillExecuting The Do While RIGHT1 RIGHT1=rc.inet1. StillExecuting DoEvents Loop End sub This building can be built. But there are a few problems. 1. How to judge whether a folder exist? I am now try to build, no matter does not exist. Is can use, but a bit wonky. 2. There is "feel strange" because the Execute is asynchronous. But now can't find these asynchronous state handling. So much press this BUTTON a few times sometimes complains... 3. Run a bit slower, sometimes run to a few seconds to complete. But actually 192.168.1.33 is the machine's IP, in theory should be done in an instant. 4. I look at the FTP server connection report, there are about 10 connections, all of the machine. But I perform Execute "CLOSE" can sometimes error sometimes, estimation is a place to do judgment. Please advice thank you!
CodePudding user response:
Str2 is path If Dir (str2) & lt;> "" Then Msgbox "exist" End If
CodePudding user response:
The DIR, "C: \ 1. TXT" or "\ \ 192.168.1.33\3. TXT" can be the But "ftp://192.168.1.33/3.txt" will be an error.