网站首页  词典首页

请输入您要查询的函数:

 

术语 netusegetinfo
释义 NetUseGetInfo
语法:
C++
NET_API_STATUS NetUseGetInfo(
__in LMSTR UncServerName,
__in LMSTR UseName,
__in DWORD Level,
__out LPBYTE *BufPtr
);
NetUseGetInfo功能
该NetUseGetInfo函数检索到的信息共享资源的连接。
您还可以使用WNetGetConnection函数来检索与本地设备相关联的网络资源的名称。
参数
UncServerName [in]
在计算机上执行此功能的UNC名称。如果这是参数为NULL,则使用本地计算机。如果UncServerName参数指定远程计算机,然后在远程计算机必须支持远程RPC调用使用传统的远程访问协议的机制。
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
用户名 [in]
一个字符串,它指定连接的返回信息的名称的指针。
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
Level [in]
数据的信息化Level的要求。此参数可以是下列值之一。
ValueMeaning
0
0Specifies本地设备的名称和远程资源的共享名称。该BufPtr参数是一个一USE_INFO_0结构的指针。
1Specifies信息之间的本地设备和共享的资源,包括连接状态和连接类型。该BufPtr参数是一个一USE_INFO_1结构的指针。
2Specifies有关地方之间的设备和共享资源的连接。信息包括连接状态,连接类型,用户名和域名。该BufPtr参数是一个一USE_INFO_2结构的指针。
BufPtr [out]
一个缓冲区,接收数据的指针。这些数据的格式取决于该级别的参数值。此缓冲区分配制度,必须使用NetApiBufferFree释放功能。有关更多信息,请参阅网络管理功能,缓冲器和网络管理功能缓冲区长度。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
备注
没有特殊组成员必须调用NetUseGetInfo功能。此函数不能执行远程服务器上的除外下级兼容的情况。
要列出本地计算机之间的所有资源和远程服务器的当前连接,您可以调用NetUseEnum功能。
此功能仅适用于服务器消息块(LAN管理工作站)客户端。该NetUseGetInfo函数不支持分布式文件系统(DFS)的股票。要检索的使用不同的网络提供商(WebDAV共享或DFS共享的信息,例如),使用WNetGetConnection功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmuse.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
NetUseEnum
网络管理概述
网络管理功能
使用功能
USE_INFO_0
USE_INFO_1
USE_INFO_2
WNetGetConnection
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetUseGetInfo Function
The NetUseGetInfo function retrieves information about a connection to a shared resource.
You can also use the WNetGetConnection function to retrieve the name of a network resource associated with a local device.
Syntax
C++
NET_API_STATUS NetUseGetInfo(
__in LMSTR UncServerName,
__in LMSTR UseName,
__in DWORD Level,
__out LPBYTE *BufPtr
);
Parameters
UncServerName [in]
The UNC name of computer on which to execute this function. If this is 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.
UseName [in]
A pointer to a string that specifies the name of the connection for which to return information.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.
Level [in]
The information level of the data requested. This parameter can be one of the following values.
ValueMeaning
0
0Specifies a local device name and the share name of a remote resource. The BufPtr parameter is a pointer to a USE_INFO_0 structure.
1Specifies information about the connection between a local device and a shared resource, including connection status and type. The BufPtr 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, connection type, user name, and domain name. The BufPtr parameter is a pointer to a USE_INFO_2 structure.

BufPtr [out]
A pointer to the buffer that receives the data. The format of this data depends on the value of the Level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths .
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
No special group membership is required to call the NetUseGetInfo function. This function cannot be executed on a remote server except in cases of downlevel compatibility.
To list all current connections between the local computer and resources on remote servers, you can call the NetUseEnum function.
This function applies only to the Server Message Block (LAN Manager Workstation) client. The NetUseGetInfo function does not support Distributed File System (DFS) shares. To retrieve information for a share using a different network provider (WebDAV or a DFS share, for example), use the WNetGetConnection function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmuse.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
NetUseEnum
Network Management Overview
Network Management Functions
Use Functions
USE_INFO_0
USE_INFO_1
USE_INFO_2
WNetGetConnection
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370648(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:23:55