📄 013.htm
字号:
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=GB2312"><TITLE>-->DELPHI专题--网络应用-->如何映射网络驱动器</TITLE>
<META NAME="keywords" CONTENT=" DELPHI专题--网络应用 如何映射网络驱动器">
<META NAME="description" CONTENT=" - DELPHI专题--网络应用 - 如何映射网络驱动器">
<style>
<!--
#page {position:absolute; z-index:0; left:0px; top:0px}
.tt3 {font: 9pt/12pt "宋体"}
.tt2 {font: 12pt/15pt "宋体"}
a {text-decoration:none}
a:hover {color: blue;text-decoration:underline}
-->
</style>
</HEAD>
<a href="index4.html">返回</a>
<body text="#000000" aLink=#9900ff link=#006699 vLink=#006699 bgcolor="#FFFFFF" leftmargin="3" topmargin="3" marginheight="3" marginwidth="3">
<TABLE WIDTH="100%" CELLPADDING=10 CELLSPACING=0 BORDER=0>
<TR>
<TD class="tt2" bgcolor="#F5F8F8" width="84%"><center><B><FONT style="FONT-SIZE: 16.5pt" COLOR="#FF6666" FACE="楷体_GB2312">如何映射网络驱动器</FONT></B></center>
<hr color="#EE9B73" size="1" width="94%">
<p>function WNetAddConnection2W(var lpNetResource: TNetResourceW; <br>
<br>
lpPassword, lpUserName: PWideChar; <br>
dwFlags: DWORD): DWORD; stdcall; <br>
<br>
To make the call you will need to fill a lpNetResource structure <br>
with a minimum set of parameters, shown in the example below. You <br>
pass this structure as the first parameter to the call, the password, <br>
user name, and a flag that indicates whether this mapping should <br>
be persistant every time the machine is logged onto. For more info <br>
on the API itself, see Window's Programmers Reference help (find the <br>
<br>
function in Windows.pas, place your text cursor over the function <br>
call, and hit F1 to bring up help). <br>
<br>
procedure TForm1.Button1Click(Sender: TObject); <br>
var <br>
NRW: TNetResource; <br>
begin <br>
with NRW do <br>
begin <br>
dwType := RESOURCETYPE_ANY; <br>
lpLocalName := 'X:'; // map to this driver letter <br>
lpRemoteName := '\\MyServer\MyDirectory'; <br>
// Must be filled in. If an empty string is used, <br>
// it will use the lpRemoteName. <br>
lpProvider := ''; <br>
end; <br>
WNetAddConnection2(NRW, 'MyPassword', 'MyUserName', <br>
<br>
CONNECT_UPDATE_PROFILE); <br>
end; 。
<hr color="#EE9B73" size="1" width="94%">
</TD>
</TR>
</table>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -