Groups | Blog | Home
all groups > dotnet faqs > january 2004 >

dotnet faqs : .Net mapping Network Drives


David Stratton
1/21/2004 1:56:13 PM
I am trying to determine how to map network drives with .net. Here's a
little background:

I work at a helpdesk in the retail industry. I currently have an
application that uses the Windows Script Host (vbscript if it matters) that
monitors our store's cash registers for a potential problem. Our cash
registers are supposed to continually send sales information over the a back
office computer real-time. Every so often, the cash registers stop
communicating with the back office PC. When this happens, there is a
temporary journal file that grows in size with each transaction.

The script that I use maps a network drive to the C: drive of each register
(using the i.p address i.e. \\192.168.1.1\C$) and uses the Windows username
and password set up in the registers. The script then checks the size of
the cache file, and if it finds a cache file that is over a certain file
size, it alerts us so we can troubleshoot the problem. Once the file size,
is checked, the drive is disconnected, so that the drive letter can be used
for the next cash register.

We are migrating amour applications to .Net, and I am looking for a .Net
solution to this. I've been through the MSDN documentation of the .Net
framework, and have not found anything that references mapping and
disconnecting Network Drives. If someone can point me to the right
documentation, I should be able to take it from there. Thanks in advance!

Chris Taylor
1/21/2004 11:24:12 PM
Hi,

..NET does not provide functionality to map and unmap network resources. You
can either execute the script files or you can use interop to access the
WNet* api functions, the following post should get you started with this
approach.

TinyURL:
http://tinyurl.com/2addz

Original URL:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=%23ehxzxP3DHA.1392%40TK2MSFTNGP11.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dchris_taylor_za%2Bwnetaddconnection

Hope this helps

--
Chris Taylor
http://dotnetjunkies.com/WebLog/chris.taylor/
[quoted text, click to view]

AddThis Social Bookmark Button