Home > Software engineering >  For help, and a written by VB file search tool (used to search for content on the Shared folder)
For help, and a written by VB file search tool (used to search for content on the Shared folder)

Time:09-18

The great god,

Happy New Year! Today is the last day of 2017, a VB source code file search tool,

Change myself, specified path is a Shared disk,

Excuse me, can give me one?

Thanks for the great god!

CodePudding user response:

Since it is "the Shared disk", that is, has taken the sharing path mapped to "network drive"?
Estimate this case, for VB6 Dir function should follow "the site operator" there is no difference... (guess, I'm going to log on to another system to verify)

You baidu "VB search files", a lot of code, reference, a change on line,

CodePudding user response:

Fyi:
 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
  • Related