1. Computing & Technology
RTL reference|Glossary|Tips/Tricks|FREE App/VCL|Books|Link Back

TNetDrive
TNetDrive is a non-visual component that connects a network path to a drive name. Full source code.
Win prizes by sharing code!
Do you have some Delphi code you want to share? Are you interested in winning a prize for your work?
Delphi Programming Quickies Contest
Join the Discussion
"Post your views, comments, questions and doubts to this article."
Discuss!
Related Resources
Using VCL components
Creating components
Networking with Delphi

Article submitted by: Michael Klaus for the Delphi Programming Quickies Contest.

TNetDrive
TNetDrive is a non-visual component that connects a network path to a drive name. It is ideal if you write a program for users in a LAN you do not want to have full write access to a certain network path, but they do have to write there sometimes.

Simply place it on your Delphi form, and, if you want to grant access, just use the function:

NetDrive.Connect(<network path>,<user name>,<password>);

The NetDrive Connect function returns the letter for the new drive.
Make your actions using this drive, and the use NetDrive.Disconnect. Your user will not even see what's happening (if a Windows Explorer is visible at the same time, he might see a new drive flashing up and disappear again). Attached to TNetDrive are two events called OnConnect and OnDisconnect. The meaning should be clear.

Download full source code!

Of course, if you have any question please post and discuss on the Delphi Programming Forum

All graphics (if any) in this feature created by Zarko Gajic.

More Delphi
· Learn another routine every day - RTL Quick Reference.
· Download free source code applications and components.
· Talk about Delphi Programming, real time.
· Link to the Delphi Programming site from your Web pages.
· Tutorials, articles, tech. tips by date: 2003|2002|2001|2000|1999|1998 or by TOPIC.
Stay informed with all new and interesting things about Delphi (for free).
Subscribe to the Newsletter
Name
Email

Got some code to share? Got a question? Need some help?

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.