网站首页  词典首页

请输入您要查询的函数:

 

术语 netuseadd
释义 NetUseAdd
语法:
C++
NET_API_STATUS NetUseAdd(
__in LMSTR UncServerName,
__in DWORD Level,
__in LPBYTE Buf,
__out LPDWORD ParmError
);
NetUseAdd功能
函数的NetUseAdd之间建立了一个本地计算机和远程服务器连接。您可以指定一个本地驱动器号或打印机设备连接。如果您没有指定一个本地驱动器号或打印机设备,功能验证与未来连接服务器的客户端。
参数
UncServerName [in]
在计算机上执行此功能的UNC名称。如果该参数为NULL,则使用本地计算机。如果UncServerName参数指定远程计算机,然后在远程计算机必须支持远程RPC调用使用传统的远程访问协议的机制。
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
Level [in]
阿值,指定数据的信息化Level。此参数可以是下列值之一。
ValueMeaning
1Specifies有关地方之间的设备和共享资源的连接。信息包括连接状态和类型。在buf参数是一个指向USE_INFO_1结构的指针。
2Specifies有关地方之间的设备和共享资源的连接。信息包括连接状态和类型,以及用户名和域名。在buf参数是一个指向USE_INFO_2结构的指针。
缓冲带 [in]
一个指定的缓冲区中的数据指针。这些数据的格式取决于该级别的参数值。有关更多信息,请参阅网络管理功能的缓冲器。
ParmError [out]
一个值,收到了错误的信息结构中第一个成员的索引时,ERROR_INVALID_PARAMETER错误返回的指针。如果该参数为NULL,则指数不返回的错误。有关详细信息,请参阅下面的备注部分。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
备注
您还可以使用WNetAddConnection2和WNetAddConnection3功能重定向本地设备到网络资源。
没有特殊组成员必须调用NetUseAdd功能。此函数不能执行远程服务器上的除外下级兼容的情况。
此功能仅适用于服务器消息块(LAN管理工作站)客户端。该NetUseAdd函数不支持分布式文件系统(DFS)的股票。要添加共享使用不同的网络提供商控制(WebDAV或DFS共享,例如),使用WNetAddConnection2或WNetAddConnection3功能。
如果NetUseAdd函数返回ERROR_INVALID_PARAMETER,您可以使用ParmError参数显示的信息结构的第一个成员,是无效的。 (信息结构开始USE_INFO_以及它的形式是指定的等级参数。)下表列出了可以返回的ParmError参数和相应的结构成员,在错误的价值观。 (前缀牛耳* _表明,成员国可以开始与多个前缀,例如,ui1_或ui2_。)
ConstantValueMember
USE_LOCAL_PARMNUM1ui * _local
USE_REMOTE_PARMNUM2ui * _remote
USE_PASSWORD_PARMNUM3ui * _password
USE_ASGTYPE_PARMNUM4ui * _asg_type
USE_USERNAME_PARMNUM5ui * _username
USE_DOMAINNAME_PARMNUM6ui * _domainname
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmuse.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
NetUseDel
网络管理概述
网络管理功能
使用功能
USE_INFO_1
USE_INFO_2
WNetAddConnection2
WNetAddConnection3
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetUseAdd Function
The NetUseAdd function establishes a connection between the local computer and a remote server. You can specify a local drive letter or a printer device to connect. If you do not specify a local drive letter or printer device, the function authenticates the client with the server for future connections.
Syntax
C++
NET_API_STATUS NetUseAdd(
__in LMSTR UncServerName,
__in DWORD Level,
__in LPBYTE Buf,
__out LPDWORD ParmError
);
Parameters
UncServerName [in]
The UNC name of the computer on which to execute this function. If this parameter is NULL, then the local computer is used. If the UncServerName parameter specified is a remote computer, then the remote computer must support remote RPC calls using the legacy Remote Access Protocol mechanism.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.
Level [in]
A value that specifies the information level of the data. This parameter can be one of the following values.
ValueMeaning
1Specifies information about the connection between a local device and a shared resource. Information includes the connection status and type. The Buf parameter is a pointer to a USE_INFO_1 structure.
2Specifies information about the connection between a local device and a shared resource. Information includes the connection status and type, and a user name and domain name. The Buf parameter is a pointer to a USE_INFO_2 structure.

Buf [in]
A pointer to the buffer that specifies the data. The format of this data depends on the value of the Level parameter. For more information, see Network Management Function Buffers .
ParmError [out]
A pointer to a value that receives the index of the first member of the information structure in error when the ERROR_INVALID_PARAMETER error is returned. If this parameter is NULL, the index is not returned on error. For more information, see the following Remarks section.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes .
Remarks
You can also use the WNetAddConnection2 and WNetAddConnection3 functions to redirect a local device to a network resource.
No special group membership is required to call the NetUseAdd function. This function cannot be executed on a remote server except in cases of downlevel compatibility.
This function applies only to the Server Message Block (LAN Manager Workstation) client. The NetUseAdd function does not support Distributed File System (DFS) shares. To add a share using a different network provider (WebDAV or a DFS share, for example), use the WNetAddConnection2 or WNetAddConnection3 function.
If the NetUseAdd function returns ERROR_INVALID_PARAMETER, you can use the ParmError parameter to indicate the first member of the information structure that is invalid. (The information structure begins with USE_INFO_ and its format is specified by the Level parameter.) The following table lists the values that can be returned in the ParmError parameter and the corresponding structure member that is in error. (The prefix ui*_ indicates that the member can begin with multiple prefixes, for example, ui1_ or ui2_.)
ConstantValueMember
USE_LOCAL_PARMNUM1ui*_local
USE_REMOTE_PARMNUM2ui*_remote
USE_PASSWORD_PARMNUM3ui*_password
USE_ASGTYPE_PARMNUM4ui*_asg_type
USE_USERNAME_PARMNUM5ui*_username
USE_DOMAINNAME_PARMNUM6ui*_domainname

Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmuse.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
NetUseDel
Network Management Overview
Network Management Functions
Use Functions
USE_INFO_1
USE_INFO_2
WNetAddConnection2
WNetAddConnection3
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370645(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:19:53