| |
|
|
|
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 CompileMarkSeparationAPI 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] |
|
|
| |
|
|
|
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 |
|
|
| |
|
|
|
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. |
|
|
| |
|
|
|
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 ▲ |
|
|
|