Re: Direcory Exists?
- From: "AMDRIT" <amdrit@xxxxxxxxxxx>
- Date: Thu, 20 Oct 2005 15:57:55 -0500
I was not able to reproduce your results. I have tried several USB drives
and they all came back as expected. I wonder if your USB device is
encrypted?
If I were to do this in VB 6, I would have used either API or FSO using
samples from Randy Birch's website vbnet.mvps.org, and it occured to me that
I didn't know how to enumerate drives in .Net. You would think that
System.IO would allow you this information, but nay. I found an article
http://www.codeproject.com/csharp/logicaldiskinfo.asp that shows
System.Management is the namespace that you would use. It appears that it
is just a WMI wrapper with late bound objects and structures.
"elziko" <elziko@xxxxxxxxxxx> wrote in message
news:e64IiBL1FHA.2924@xxxxxxxxxxxxxxxxxxxxxxx
>I want to use the Directory.Exists method to see if a directory exists. But
>it doesn't seem to work for the root of a removable (USB) drive.
>
> I plug in my drive and it gets allocated a letter ("F:"). I then confirm
> that I can view the drive in Windows Explorer but:
>
> Directory.Exists("F:\")
>
> returns False!
>
> Directory.Exists("C:\")
>
> returns True as expected!
>
> Is this by design or a bug? Is there an alternative that will work for all
> paths including on removable drives?
>
> TIA
>
.
- References:
- Direcory Exists?
- From: elziko
- Direcory Exists?
- Prev by Date: Re: VB.NET & Win2K Users Security
- Next by Date: Re: best way to wait for async delegate calls to complete
- Previous by thread: Direcory Exists?
- Next by thread: Re: Column rearrange in list view
- Index(es):
Relevant Pages
|