Home > Software engineering >  Excuse me INET control how to judge whether a FTP folder exist?
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.

CodePudding user response:

refer to the second floor WZQX response:
use 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.

For reference only
 ServerShare="\ \ 192.168.3.56 \ d $" 
The UserName="somedomain \ someuser"
Password="somepassword"

The Set NetworkObject=CreateObject (" work "WScript.Net

NetworkObject. MapNetworkDrive ", "ServerShare, False, UserName, Password,"

The Set of FSO=CreateObject (" Scripting. FileSystemObject ")
Set the Directory=FSO. GetFolder (ServerShare)
For Each FileName In the Directory. The Files
WScript. Echo FileName. The Name
Next
Set the FileName=Nothing
Set the Directory=Nothing
The Set of FSO=Nothing

NetworkObject. RemoveNetworkDrive ServerShare, True, False

The Set NetworkObject=Nothing

CodePudding user response:

 Private Sub Command1_Click () 
'rc.inet1. Cancel asynchronous operations to be performed as far as possible, otherwise state is difficult to control'
If rc.inet1. StillExecuting Then Exit Sub 'prevent reentrant'

.
End Sub

CodePudding user response:

Turned out to be use WIN XP document sharing function of direct call. Very convenient.
But now added a few computer systems become more than XP 10 Shared a connection limit.
So "\ \ 192.168.1.33 " this kind of connection method cannot be used.
So we want to change to FTP
As for what will not switch to SERVER2003 or something. Knowledge of the small business owner fighting capacity.

CodePudding user response:

Use of or XP?

Use the server?

CodePudding user response:

XP has 10 sharing connections limit?
Can change a registry entry more?
 [HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion Internet Settings \] 
"MaxConnectionsPerServer"=dword: 00000040
"MaxConnectionsPer1_0Server"=dword: 00000040

CodePudding user response:

Master is the master, learning,

CodePudding user response:

MaxConnectionsPerServer
Seems to just change the number of connections, such as IE
If it is to use network Shared folder access
Such as "\ \ 192.168.1.33
"And things like that.
More than 10 computers will prompt to limit.
Checked N haven't solution. Many places is XP a the things I cannot change.

Is not only adapted a SERVER 2003.

CodePudding user response:

Why so many Shared folder,
Specify a machine a directory can be Shared, as required under the molecular directory,
Since all use a Shared folder, of course is designed according to the premise of trusted,

CodePudding user response:

Check I upload this resources, a few words of simple code can achieve a FTP upload download tools, you can reference, the enumeration of
http://download.csdn.net/detail/nanfei01055/1841290

CodePudding user response:

This program provides progress event interface, can write their own progress
  • Related