请问各位有没有什么API函数可以实现WINDOWS下NET SEND的功能??

chen_yj 2003-08-20 02:59:47
请问各位有没有什么API函数可以实现WINDOWS下NET SEND的功能??
...全文
23 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chen_yj 2003-08-26
  • 打赏
  • 举报
回复
可否通过网关在局域网中向INTERNET发送信息?能通过上面的函数实现吗?如果不行请问各位大侠有没有什么好的办法?
chen_yj 2003-08-22
  • 打赏
  • 举报
回复
用此API时,如果发送成功,则会很快,但如果不成功要等很长一段时间才会返回一个值。有没有好的办法发送出去以后就不管状态,直接往下运行呢?我知道用线程可以处理,但不想用这种方法!
kingzai 2003-08-22
  • 打赏
  • 举报
回复
i suggest you set a time-out for Net send.
喝醉的咖啡 2003-08-20
  • 打赏
  • 举报
回复
NetMessageBufferSend

The NetMessageBufferSend function sends a buffer of information to a registered message alias.


NET_API_STATUS NetMessageBufferSend(
LPCWSTR servername,
LPCWSTR msgname,
LPCWSTR fromname,
LPBYTE buf,
DWORD buflen
);

Parameters
servername
[in] Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.

Windows NT: This string must begin with \\.


msgname
[in] Pointer to a constant string that specifies the message alias to which the message buffer should be sent.
fromname
[in] Pointer to a constant string specifying who the message is from. If this parameter is NULL, the message is sent from the local computer name.
buf
[in] Pointer to a buffer that contains the message text. For more information, see Network Management Function Buffers.
buflen
[in] Specifies a value that contains the length, in bytes, of the message text pointed to by the buf parameter.
Return Values
If the function succeeds, the return value is NERR_Success.

If the function fails, the return value can be one of the following error codes.

Return Code Description
ERROR_ACCESS_DENIED The user does not have access to the requested information.
ERROR_INVALID_PARAMETER The specified parameter is invalid.
ERROR_NOT_SUPPORTED This network request is not supported.
NERR_NameNotFound The user name could not be found.
NERR_NetworkError A general failure occurred in the network hardware.

Remarks
If you call this function on a domain controller that is running Active Directory, access is allowed or denied based on the access control list (ACL) for the securable object. The default ACL permits only Domain Admins and Account Operators to call this function. On a member server or workstation, only Administrators and Server Operators can call this function. For more information, see Security Requirements for the Network Management Functions. For more information on ACLs and ACEs, see Access Control Model.


Windows NT: No special group membership is required to execute the NetMessageBufferSend function on a LAN Manager or a Windows NT system. Admin, Accounts, Print, or Server Operator group membership is required to successfully execute NetMessageBufferSend on a remote server.


Requirements
Client: Included in Windows XP, Windows 2000 Professional, and Windows NT Workstation.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server.
Header: Declared in Lmmsg.h; include Lm.h.
Library: Use Netapi32.lib.

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧