建立一帐号aaa, 密码bbb
不要用system("...");
不要用system("...");
解决方案 »
- WinInet POST HttpSendRequest总返回错误
- DOS下可以贴图吗?
- VC++2008添加按钮问题。
- 问题:在VB、C#,vb.net(windows form)中调用可以,但是在ASP.net中就出错
- 在Dialog 中除了OnCancel()可关闭自身外还有其他函数吗??
- Help,对于已取得的Region(HRGN)的位图,如何取得它(Region)的边界点的数组,谢谢!!
- 寻求网络语音开发帮助,SOS.............................
- 请问我如何在vc程序中新建一个.txt文件,并向里面写数据呢,有例子最好
- DIRECTSHOW回调函数SetCallBack CB.BufferCB无效
- 判断一个控件是否被按下并弹起
- 如何将编辑栏中的字符串显示到列表框中?
- ??想实现磁盘总值,但运行后是显示每个分区的值,来帮忙看代码
#define UNICODE
#endif#include <stdio.h>
#include <windows.h>
#include <lm.h>
#pragma comment(lib,"Netapi32.lib")
int wmain(int argc, wchar_t *argv[])
{
USER_INFO_1 ui;
DWORD dwLevel = 1;
DWORD dwError = 0;
NET_API_STATUS nStatus; if (argc != 3)
{
fwprintf(stderr, L"Usage: %s \\\\ServerName UserName\n", argv[0]);
exit(1);
}
//
// Set up the USER_INFO_1 structure.
// USER_PRIV_USER: name identifies a user,
// rather than an administrator or a guest.
// UF_SCRIPT: required for LAN Manager 2.0 and
// Windows NT and later.
//
ui.usri1_name = argv[2];//这是用户名。
ui.usri1_password = argv[2]; //这是密码。
ui.usri1_priv = USER_PRIV_USER;
ui.usri1_home_dir = NULL;
ui.usri1_comment = NULL;
ui.usri1_flags = UF_SCRIPT;
ui.usri1_script_path = NULL;
//
// Call the NetUserAdd function, specifying level 1.
//
nStatus = NetUserAdd(argv[1],
dwLevel,
(LPBYTE)&ui,
&dwError);
//
// If the call succeeds, inform the user.
//
if (nStatus == NERR_Success)
fwprintf(stderr, L"User %s has been successfully added on %s\n",
argv[2], argv[1]);
//
// Otherwise, print the system error.
//
else
fprintf(stderr, "A system error has occurred: %d\n", nStatus); return 0;
}