473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is Folder Local

Is there a way to tell if path is on a local drive instead of a mapped drive
or network. Thanks

- Fred
Sep 22 '06 #1
3 2292
Hi,

Are you in 2.0 ? if so there is a new class DriveInfo tht can give you this
info.

Don't quite remember how to get it in 1.1 (without using either w32 or WMI)
do a search in the archives.

"Fred W." <fr*************@yahoo.comwrote in message
news:eB****************@TK2MSFTNGP06.phx.gbl...
Is there a way to tell if path is on a local drive instead of a mapped
drive or network. Thanks

- Fred

Sep 22 '06 #2
In the windows api kernel32.dll there is a function GetDriveTypeA
it takes in a string containing the drive letter and returns an int which
means:
2 = Removable Drive
3 = Fixed Drive
4 = Remote / Network drive
5 = CDROM/DVD
6 = Ram Disk

HTH
Ciaran O'Donnell

"Fred W." wrote:
Is there a way to tell if path is on a local drive instead of a mapped drive
or network. Thanks

- Fred
Sep 22 '06 #3

"Fred W." <fr*************@yahoo.comwrote in message
news:eB****************@TK2MSFTNGP06.phx.gbl...
| Is there a way to tell if path is on a local drive instead of a mapped
drive
| or network. Thanks
|
| - Fred
|
|

DriveInfo.DriveType.
But this requires a mapped drive which is something you should avoid in your
code whenever you can. Use UNC paths (\\server\path\file) to access network
shares.

Willy.
Sep 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Kim Lots | last post by:
Hi Sorry to disturb you again but i really like to know what's the NTFS folder permissions on a "virtual directory" folder for a public webserver iis 5.x running ASP 3.0 with an Access DB on a...
4
by: Yuri Vorontsov | last post by:
Hallo! We have troubles (post XP SP2) to open local folders from the web application: - the web application allows users to select a local file (input type=file) - the system DOES NOT upload...
1
by: PeterNZ | last post by:
Hi all, I developped an C# app which is using FileSystemWatcher. If a file is created in a specific folder, it opens the file and does some processing. This functionality works without...
2
by: Jon L. Lovesky | last post by:
Hello all, I am attempting to access a remote folder from an asp.net application (all within the same domain). The application is configured for windows authentication in IIS and the asp.net...
1
by: Manish Songar via .NET 247 | last post by:
(Type your message here) I am using asp.net. I am not storing image in sql server.I storeall the image in one folder. I want to access image from thatfolder to my client machine. Images folder...
2
by: brett | last post by:
On my local machine, I've created an ASP.NET website, which will go into a sub folder of a website on a remote web server. I did this on my local machine because at some point, this site will have...
0
by: jason | last post by:
I googled a lot, couldn't find a good solution. Any help is greatly appreciated. What I want to do is: Given a web page in a running IE browser , i want to save an image in this web page to...
8
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if...
0
by: Chuck Anderson | last post by:
I'm trying to come with a good organization plan for the Apache, Php, MySQL development software on my home PC and am wondering what sort of folder structure others may have come up with that seems...
12
by: Reggie | last post by:
Hi And TIA. Running VS2005 and IIS7.0. I have a procedure that copies a file to a folder in my web application. When I run the project from VS it runs fine . I'm usin IE as default viewer. But...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.