Function GetNetworkDriveMappings(SList:TStrings):Integer;
Var
I:Char;
ThePath:String;
MaxNetPathLen:DWord;
Begin
SList.Clear;
MaxNetPathLen:=MAX_PATH;
SetLength(ThePath,MAX_PATH);
For I := 'A' to 'Z' Do
If WNetGetConnection(
PChar(''+I+':'),PChar(ThePath),
MaxNetPathLen)=NO_ERROR Then
SList.Add(I+': '+ThePath);
Result := SList.Count;
End;
// Kullanimi:
procedure TForm1.Button1Click(Sender: TObject);
begin
GetNetworkDriveMappings(Form1.ListBox1.Items);
end;