获取命令行参数-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

获取命令行参数

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;
	}
}

文章题目:获取命令行参数
网页URL:http://kswsj.cn/article/ihjjig.html

其他资讯