当前位置:编程文档 >> DELPHI >> 在DELPHI中映射网络驱动器
首页

在DELPHI中映射网络驱动器

所属类别:DELPHI
推荐指数:★★☆
文档人气:29
本周人气:1
发布日期:2007-5-11

function WNetAddConnection2W(var lpNetResource: TNetResourceW;lpPassword, lpUserName: PWideChar; dwFlags: DWORD): DWORD; stdcall;

首先要填一个 lpNetResource structure,然后 password,user name, 和一个标志表明是否这个映射每次登录时都要还原。详情见帮助。

var  
  NRW: TNetResource;
begin  
  with NRW do begin dwType := RESOURCETYPE_ANY;
  lpLocalName := 'X:'; // map to this driver letter
  lpRemoteName := '\\MyServer\MyDirectory';
  // Must be filled in. If an empty string is used,
  // it will use the lpRemoteName. lpProvider := ''; end;
  WNetAddConnection2(NRW, 'MyPassword', 'MyUserName', CONNECT_UPDATE_PROFILE);end; 

文档说明:

     

相关文档


读取评论列表……