系统:WIN2003,DHCP服务器。我现在需要编程实现自动新建保留客户端、修改已有保留客户端的MAC等等,请问是否能实现,如何能实现?
谢谢!问题解决追加分数50!
谢谢!问题解决追加分数50!
解决方案 »
- 传说中的Win 7 托盘图标显示问题【解决方案】
- VC6中有个Components and Controls Gallery,通过Visual C++ Components,可以快速地添加一些功能,VC2005中有吗?
- vc下的ListCtrl控件不带表头总显示不出数据?
- 如何通过声卡获取输入音频(单频)的频率、幅度
- Console下的指针函数怎么移植到对话框程序中?小弟分不多,先谢谢大家了!!!
- 如何在CListCtrl中插入系统的图标?(如果.htm后缀的文件就显示ie那个图标)
- 急急急!!!请问一个vc问题!
- VC2010的IDE编辑器中,空格都被显示成了小点,怎么办
- 如何修改MDI的背景颜色,在设定属性为只读,变灰,如何变白。
- 能从一个Button的处理流程goto到另一个Button的处理流程并返回吗?
- exe中如何嵌入另一个exe
- 关于CArchive 原理的问题,请高手解答!!
Platform SDK: Dynamic Host Configuration Protocol (DHCP)
DHCP Server Management API Functions
The following functions comprise the DHCP Server Management API library.Function Description
DhcpCreateClientInfo Creates a client information record on the DHCP server.
DhcpDeleteClientInfo Deletes a client information record from the DHCP server.
DhcpEnumSubnetClients Returns an enumerated list of clients with served IP addresses in the specified subnet.
DhcpEnumSubnets Returns an enumerated list of subnets defined on the DHCP server.
DhcpGetClientInfo Returns information about a specific DHCP client.
DhcpGetOptionValue Retrieves a DHCP option value (the option code and associated data) for a particular scope.
DhcpGetServerBindingInfo Returns endpoint bindings set on the DHCP server.
DhcpGetSubnetInfo Returns information on a specific subnet.
DhcpGetVersion Returns the major and minor version numbers of the DHCP server.
DhcpRpcFreeMemory Frees a block of buffer space returned as a parameter by the Remote Procedure Call (RPC) service.
DhcpSetClientInfo Sets information on a client whose IP address lease is administrated by the DHCP server.
DhcpSetServerBindingInfo Sets endpoint bindings for the DHCP server. 比如DhcpEnumSubnetClients
The DhcpEnumSubnetClients function returns an enumerated list of clients with served IP addresses in the specified subnet.DWORD DHCP_API_FUNCTION DhcpEnumSubnetClients(
DHCP_CONST WCHAR* ServerIpAddress,
DHCP_IP_ADDRESS SubnetAddress,
DHCP_RESUME_HANDLE* ResumeHandle,
DWORD PreferredMaximum,
LPDHCP_CLIENT_INFO_ARRAY* ClientInfo,
DWORD* ClientsRead,
DWORD* ClientsTotal
);Parameters
ServerIpAddress
[in] Unicode string that specifies the IP address of the DHCP server.
SubnetAddress
[in] DHCP_IP_ADDRESS value that contains the subnet ID. See RFC 950 for more information about subnet ID.
ResumeHandle
[in, out] Pointer to a DHCP_RESUME_HANDLE value that identifies the enumeration operation. Initially, this value should be zero, with a successful call returning the handle value used for subsequent enumeration requests. For example, if PreferredMaximum is set to 1000 bytes, and 2000 bytes worth of subnet client information structures are stored on the server, the resume handle can be used after the first 1000 bytes are retrieved to obtain the next 1000 on a subsequent call, and so forth.
PreferredMaximum
[in] Specifies the preferred maximum number of bytes of subnet client information structures to return. If the number of remaining unenumerated options (in bytes) is less than this value, then that amount will be returned.
The minimum value is 1024 bytes (1KB), and the maximum value is 65536 bytes (64KB); if the input value is greater or less than this range, it will be set to the maximum or minimum value, respectively.ClientInfo
[out] Pointer to a DHCP_CLIENT_INFO_ARRAY structure that contains information on the clients served under this specific subnet. If no clients are available, this field will be null.
ClientsRead
[out] Pointer to a DWORD value that specifies the number of clients returned in ClientInfo.
ClientsTotal
[out] Pointer to a DWORD value that specifies the number of clients for the specified subnet that have not yet been enumerated.
Note This value is set to the correct value during the final enumeration call; however, prior calls to this function set the value as "0x7FFFFFFF".Return Values
This function returns ERROR_MORE_DATA upon a successful call. The final call to this method with the last set of subnet clients returns ERROR_SUCCESS. Otherwise, it returns one of the DHCP Server Management API Error Codes.
Res
This function requires host byte ordering for all DHCP_IP_ADDRESS values in parameter structures.Requirements
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Header Declared in Dhcpsapi.h.
Library Link to Dhcpsapi.lib.
DLL Requires Dhcpsapi.dll. 不过个人还是对批处理比较感兴趣。
我也没做过,一样不会,要慢慢试才行,这个属于比较偏的,估计做的人比较少。你再试试能不能找到一些开源的代码吧。
网上相关的东西也少,翻来覆去也总是那几个函数,不是copy的MSDN,就是语焉不详,想必更没有源码了。我再多试试,有什么问题再向你请教,还望不吝赐教!