Danke für den Tip
Du meinst so in etwa
Delphi-Quellcode:
function ShareOnline(
unc:
string): Boolean;
var
IdTCPClient1: TIdTCPClient;
begin
if Pos('
\\',
unc) = 1
then
begin
IdTCPClient1 := TIdTCPClient.Create(Self);
with IdTCPClient1
do
begin
Name := '
IdTCPClient1';
Port := 139;
end;
Delete(
unc, 1, 2);
Delete(
unc, Pos('
\',
unc), Length(
unc));
IdTCPClient1.Host :=
unc;
try
IdTCPClient1.Connect(500);
except
Result := false;
end;
if IdTCPClient1.Connected
then
begin
IdTCPClient1.Disconnect;
Result := true;
end;
end;
end;
P.S. Die BackSlash's waren auch beim ersten alle da