Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I dont know how...
Message
From
14/12/2000 20:59:12
 
 
To
14/12/2000 17:22:26
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00453653
Message ID:
00453730
Views:
34
>Hello alls.
>It´s my firts time work with Visual Basic and I dont know how:
>- Conect a network drive

You can use the Wscript.Network object to map a UNC to a local drive using the MapNetworkDrive method, or the Win32 API call WNetAddConnection2()

>- copy file (The name of the files depends of the date,for example: PB120200.
>How read the month, the day, and the year.)

Both are handled by the Scripting.FileSystemObject, as well as by native VB functions. You can get the file and copy it, and look at all three of the date/time stamps if they're published. You can use the API CopyFile() or SHFileOperation() API calls. You can open the file for low-level I/O reading the existing file and writing the data to a new file. Lots of ways.

>- Disconect a network drive

WSH RemoveNetworkDrive method or WNetCancelConnection() in the API

I recommend the WSH objects for ease of use and greatest functionality.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform