Solved

Delphi Programming question

Posted on 1997-07-01
1
168 Views
Last Modified: 2010-04-04
Hello,I want to get a list of available drives, preferabily with drive types with delphi 2.0.I have found the relevent API calls but was wondering if there was an delphi function call to do this?
0
Comment
Question by:essbb
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 60 total points
ID: 1338057
There is _no_ native Delphi call that does what you want.
The API-command works really fine, something like this:

  for DriveChar := 'A' to 'Z' do begin
    DriveType := GetDriveType(PChar(DriveChar+':\'));
    if DriveType>1
    then begin
      case DriveType of
        DRIVE_REMOVABLE : begin {Add to list here} end;
        DRIVE_FIXED     : begin {Add to list here} end;
        DRIVE_REMOTE    : begin {Add to list here} end;
        DRIVE_RAMDISK   : begin {Add to list here} end;
        DRIVE_CDROM     : begin {Add to list here} end;
      end;
    end else {This drive doesn't exist};
  end;

This will work on the logical drives 'A:'-'Z:', but not on
the unconnected "network" shares '\\server\share'.
For that you need another approach.

Hope this helps!

/// John

0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JAudiorecorder record freezing the app 29 68
Multi-layered image in FireMonkey 9 38
Delphi: sending SMS on android platform 1 21
shape, triangle, dbctrlgrid 3 5
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question