English
Regulars table & Café

GetDriveType.

 


Description:

GetDriveType determined whom type one Laufwerks.




Deklaration:

Def @GetDriveType(1) !KERNEL32,GetDriveTypeA




Parameter:

1.Parameter: address one Strings or Memory-Variable with a String, the the Rootverzeichnis the Laufwerks angibt.



Return Value:

The manner the Laufwerks.
0 = The Laufwerkstyp couldn't determined go.
1 = Daa Rootverzeichnis existing not.
2 = volume can from the unit entnommen go, z.B. Diskettenlaufwerk (DRIVE_REMOVABLE).
3 = volume can't from the unit entnommen go, z.B. Festplatte (DRIVE_FIXED).
4 = Netzwerklaufwerk (DRIVE_REMOTE).
5 = CD-ROM (DRIVE_CDROM).
6 = RAM-Disk (DRIVE_RAMDISK)


Examples:

CompileMarkSeparation
Def @GetDriveType(1) !"KERNEL32","GetDriveTypeA"
Declare Art$,buf#
DIM buf#,4
String buf#,0="D:"

IF GetDriveType(buf#)=2

    LET Art$="Diskettenlaufwerk"

elseIF GetDriveType(buf#)=3

    LET Art$="Festplatte"

elseIF GetDriveType(buf#)=4

    LET Art$="Netzwerklaufwerk"

elseIF GetDriveType(buf#)=5

    LET Art$="CD-ROM"

elseIF GetDriveType(buf#)=6

    LET Art$="RAM-Drive"

endif

Dispose buf#
@messagebox("Laufwerk D: ist ein(e) "+Art$+".","Meldung",64span class=s2>)

CompileMarkSeparation
API to that lists the drives
Def GetLogicalDrives(0) !"KERNEL32","GetLogicalDrives"
API to that discern the Laufwerksart
Def GetDriveType(1) !"KERNEL32","GetDriveTypeA"
Declare drives&,i%,d$,buf#,manner$,Kapazität&,Belegt&,Frei&
Bitliste with present Laufwerken ( A-Z, 0=not present 1=present)
Let drives&=GetLogicalDrives()
Dim buf#,4

While Lt(i%,26)

    If TestBit(drives&,i%) if drive present...

        Let d$=Chr$(Add(i%,65));":"
        String buf#,0=d$ Laufwerkstring becomes in Memory-Variable laid
        request, which drive recognized watts

        IF GetDriveType(buf#)=2

            LET manner$="Diskettenlaufwerk"

        elseIF GetDriveType(buf#)=3

            LET manner$="Festplatte"

        elseIF GetDriveType(buf#)=4

            LET manner$="Netzwerklaufwerk"

        elseIF GetDriveType(buf#)=5

            LET manner$="CD-ROM"

        elseIF GetDriveType(buf#)=6

            LET manner$="RAM-Drive"

        endif

        ADDSTRING Add$(Add$(d$," type: "),ART$)
        LET Kapazität&=@DiskSize(D$)
        LET Frei&=@DiskFree(D$)
        LET BELEGT&=@sub(@DiskSize(D$),@DiskFree(D$))
        ADDSTRING @add$("-Gesamter Speicherplatz: ",@add$(@st$(Kapazität&)," Bytes"))
        ADDSTRING @add$("-occupied: ",@add$(@STR$(Belegt&)," Bytes"))
        ADDSTRING @add$("-spare: ",@add$(@STR$(Frei&)," Bytes"))
        ADDSTRING ""

    EndIf

    Inc i%

Wend

Dispose buf#
@$ ListBox("Laufwerkstypen",2)

[keywords:e567d82cca]
drive type CD-ROM Festplatte RAM read Laufwerkstyp manner
[/keywords:e567d82cca]
 
04/19/05  
 




GDL
Hallöle,

I own in the momentum weder one Handy another Digitalkammera to that testing.
entrapments these tools then under RAM-Disk or under DRIVE_REMOVABLE. ?

Perhaps wisely it someone too so. thanks.

Grüßle
Georg
 
XProfan X3
Windows7 Xprofan 8,9,10 [...]  [...] 
09/01/15  
 




Jörg
Sellmeyer
I can it in the momentum neither testing but I would RAM-Disk time exclude, there the Yes a in the Hauptspeicher Dropped virtual "Festplatte" is.
there Yes Digitalkameras and Handys by USB addressed go, dürften tappt im dunkeln well as DRIVE_REMOVABLE firmieren.
my USB-Stick becomes anyway as such recognized (type 2).
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
09/01/15  
 




HofK
SELTSAM!

I have under Win 8.1 one Diskettenlaufwerk! - behauptet anyway the first Beispielkode if I my Digitalkamera on USB 3.0 angebe.

my Ramdisk becomes as despicable Festplatte aufgelistet and my Handy has none Laufwerksbuchstaben, only a names.
 
09/01/15  
 




Jörg
Sellmeyer
i'd say, you have one drive of type 2 - the can (must but not) one Diskettenlaufwerk his.

The code is there sooner inaccurate...
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
09/01/15  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.690 Views

Untitledvor 0 min.
Magda07/07/16
Michael Borowiak09/10/15
R.Schneider09/08/15
RudiB.09/07/15
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie