Article View: borland.public.cppbuilder.nativeapi
Article #6716Re: query drive letter to see if it is a mapped network drive
From: Vladimir Stefanovic
Date: Sun, 17 Apr 2005 14:12
Date: Sun, 17 Apr 2005 14:12
53 lines
2403 bytes
2403 bytes
I think that API GetDriveType() & DRIVE_REMOTE is you
answer, but not sure, anyway try it:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for ( char i='A'; i<='Z'; i++ )
{
AnsiString Drive = AnsiString( i ) + ":";
int gdt = GetDriveType( Drive.c_str() );
if ( gdt > 1 )
{
AnsiString Text;
switch ( gdt )
{
case DRIVE_REMOVABLE :
Text = " REMOVABLE";
break;
case DRIVE_FIXED :
Text = " FIXED";
break;
case DRIVE_REMOTE :
Text = " REMOTE (NETWORK)";
break;
case DRIVE_CDROM :
Text = " CD-ROM";
break;
case DRIVE_RAMDISK :
Text = " RAMDISK";
break;
}
Memo1->Lines->Add( Drive + Text );
}
}
}
--
Best regards,
Vladimir Stefanovic
"Peter Van Hove" <Will_Bounce_So_Use_My_First_Name@Smart-Projects.net> wrote
in message news:4261890e@newsgroups.borland.com...
> Hi,
>
> Is it possible to query a drive letter to see if it is a mapped network
> drive instead of a storage device in the system itself ?
> If so, how ?
> And also, will there not be annoying time-outs when this network drive
> disconnects at some point and the query is run ?
>
Technical Details
Message-ID:
<42626edb@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.inode.at!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4261890e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4d4eec3eb7175b0b X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.nativeapi References: <4261890e@newsgroups.borland.com> Subject: Re: query drive letter to see if it is a mapped network drive Date: Sun, 17 Apr 2005 16:12:47 +0200 Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 82.117.212.65 Message-ID: <42626edb@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1113747163 82.117.212.65 (17 Apr 2005 07:12:43 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.inode.at!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail