新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

获取命令行参数

VOID StartMain()
{
	LPWSTR *szArglist;
	int nArgs;
	int i;
	szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
	if (NULL == szArglist)
	{
		wprintf(L"CommandLineToArgvW failed\n");
		return ;
	}
	else
	{
		for (i = 0; i < nArgs; i++)
		{
			CString strTemp;
			strTemp.Format(_T("%s"), szArglist[1]);
			if (strTemp == _T("1"))
				StartPrintServer();
			if (strTemp == _T("2"))
				StarUserManage();

		}
		//释放CommandLineToArgvW参数占用的内存.
		LocalFree(szArglist);
		return;
	}
}

本文标题:获取命令行参数
本文路径:http://www.wjwzjz.com/article/ihjjig.html
在线咨询
服务热线
服务热线:028-86922220
TOP