方法一: 1 2 3 4 CString sCmdline = ::GetCommandLine(); AfxMessageBox(sCmdline); 将获取到 "C:\test\app.exe -1 -2 " 方法二: 1 2 3 4 5 6 7 for (int i = 0; i < __argc; i++) { __argv[i]; AfxMessageBox(__argv[i]); } 将依次得到"C:\test\app.exe","-1", "-2" 方法三: 1 2 CString sCmdline = AfxGetApp()->m_lpCmdLine; 将获取到 "-1 -2 ",AfxGetApp()->m_lpCmdLine 只包含参数。