Google
 

Thursday, November 8, 2007

Mengetahui Jumlah Mapping Drive dalam Jaringan Komputer


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function
GetNetworkDriveMappings (SList: TStrings): integer;
var
____c: Char;
____ThePath: string;
____MaxNetPathLen: DWord;
begin
____SList.Clear;
____MaxNetPathLen := MAX_PATH;
____SetLength(ThePath, MAX_PATH) ;
____for c := 'A' to 'Z' do
____if WNetGetConnection(PChar('' + c + ':'), PChar(ThePath),MaxNetPathLen) = NO_ERROR then ____________sList.Add(c + ': ' + ThePath) ;
____Result := SList.Count;
end;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No comments: