X
xiaoyang
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button6Click(Sender: TObject);
var NetR :NETRESOURCE;ErrInfo : Longint;
begin
NetR.dwScope := RESOURCE_GLOBALNET;
NetR.dwType := RESOURCETYPE_DISK;
NetR.dwDisplayType := RESOURCEDISPLAYTYPE_SHARE;
NetR.dwUsage := RESOURCEUSAGE_CONNECTABLE;
NetR.lpLocalName := 'X:';
NetR.lpRemoteName := '//192.168.1.6/';
ErrInfo := WNetAddConnection2(NetR, '', '', CONNECT_UPDATE_PROFILE);
If ErrInfo = NO_ERROR Then
messagebox(0,'Net connection successful!','',0)
Else
messagebox(0,'error','',0);
end;
为什么执行后一直提示error,而不是打开.网络路径是存在的.
我在WINDOW系统下测试.
var NetR :NETRESOURCE;ErrInfo : Longint;
begin
NetR.dwScope := RESOURCE_GLOBALNET;
NetR.dwType := RESOURCETYPE_DISK;
NetR.dwDisplayType := RESOURCEDISPLAYTYPE_SHARE;
NetR.dwUsage := RESOURCEUSAGE_CONNECTABLE;
NetR.lpLocalName := 'X:';
NetR.lpRemoteName := '//192.168.1.6/';
ErrInfo := WNetAddConnection2(NetR, '', '', CONNECT_UPDATE_PROFILE);
If ErrInfo = NO_ERROR Then
messagebox(0,'Net connection successful!','',0)
Else
messagebox(0,'error','',0);
end;
为什么执行后一直提示error,而不是打开.网络路径是存在的.
我在WINDOW系统下测试.