求教 system error:53

fox513 2009-08-10 09:34:24
#ifndef UNICODE
#define UNICODE
#endif

#include <stdio.h>
#include <windows.h>
#include <lm.h>
#pragma comment(lib , "Netapi32.lib")
int wmain(int argc, wchar_t *argv[])
{
DWORD dwLevel = 10;
LPUSER_INFO_10 pBuf = NULL;
NET_API_STATUS nStatus;

if (argc != 3)
{
fwprintf(stderr, L"Usage: %s \\\\ServerName UserName\n", argv[0]);
exit(1);
}
//
// Call the NetUserGetInfo function; specify level 10.
//
nStatus = NetUserGetInfo(argv[1],
argv[2],
dwLevel,
(LPBYTE *)&pBuf);
//
// If the call succeeds, print the user information.
//
if (nStatus == NERR_Success)
{
if (pBuf != NULL)
{
wprintf(L"\n\tAccount: %s\n", pBuf->usri10_name);
wprintf(L"\tComment: %s\n", pBuf->usri10_comment);
wprintf(L"\tUser comment: %s\n", pBuf->usri10_usr_comment);
wprintf(L"\tFull name: %s\n", pBuf->usri10_full_name);
}
}
// Otherwise, print the system error.
//
else
fprintf(stderr, "A system error has occurred: %d\n", nStatus);
//
// Free the allocated memory.
//
if (pBuf != NULL)
NetApiBufferFree(pBuf);

return 0;
}
在vs下编译生成test.exe文件 在dos提示符进入test.exe文件所在文件夹,输入test.exe null administrator 回车后报错 a system error has occurred:53
这是怎么回事呀,源文件时msdn里复制过来的
...全文
215 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
fox513 2009-08-10
  • 打赏
  • 举报
回复
楼上能说具体点吗?我是初学的 不是很懂
oyljerry 2009-08-10
  • 打赏
  • 举报
回复
Unknown file error (GetLastError=53):

2,643

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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