L
liujzi
Unregistered / Unconfirmed
GUEST, unregistred user!
大家看看这个远程关机程序,我想用程序方式先以管理员登录上对方电脑,然后再控制对方电脑,但没有什么反映(应该是还没登录上对方电脑),请指点。
注:本地机名:LJZ
对方电脑名:WQW
对方user:administrator PASSWORD:microsoft
谢谢!
procedure Tserver.Button1Click(Sender: TObject);
var
aa:TNetResource;
retval : integer;
begin
aa.dwScope := RESOURCE_CONNECTED;
aa.dwType := RESOURCETYPE_ANY;
aa.lpLocalName := '';
aa.lpRemoteName := 'wqw';
aa.lpProvider := Nil;
RetVal := WNetAddConnection2(aa,'microsoft','administrator',0);
showmessage(inttostr(retval));
InitiateSystemshutdown('wqw','HELLO',10,true,true);
end;
注:本地机名:LJZ
对方电脑名:WQW
对方user:administrator PASSWORD:microsoft
谢谢!
procedure Tserver.Button1Click(Sender: TObject);
var
aa:TNetResource;
retval : integer;
begin
aa.dwScope := RESOURCE_CONNECTED;
aa.dwType := RESOURCETYPE_ANY;
aa.lpLocalName := '';
aa.lpRemoteName := 'wqw';
aa.lpProvider := Nil;
RetVal := WNetAddConnection2(aa,'microsoft','administrator',0);
showmessage(inttostr(retval));
InitiateSystemshutdown('wqw','HELLO',10,true,true);
end;