Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delphi Programming question

Posted on 1997-07-01
1
Medium Priority
?
189 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 180 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

824 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