W
wangfangzhen
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
ns: NETRESOURCE;
begin
ns.lpLocalName := nil;
ns.lpProvider := '';
ns.lpRemoteName := pchar('//192.168.0.150');
if WNetAddConnection2(ns,'','administrator',0)= 0 then
ShowMessage('success')
else
ShowMessage('fail');
end;
var
ns: NETRESOURCE;
begin
ns.lpLocalName := nil;
ns.lpProvider := '';
ns.lpRemoteName := pchar('//192.168.0.150');
if WNetAddConnection2(ns,'','administrator',0)= 0 then
ShowMessage('success')
else
ShowMessage('fail');
end;