我有一个由RPX Packer压缩并受密码保护的dotnet winform应用程序。可以从Windows命令提示符打开应用程序,提供密码作为命令行参数(例如MyApp.exe)。我想从本机C ++应用程序启动dotnet应用程序而不是命令提示符。我尝试了下面的代码,它没有密码,但是密码出现了一些加密错误。
#include "stdafx.h"
#include "windows.h"
#include "shellapi.h"
int _tmain(int argc, _TCHAR* argv[])
{
SHELLEXECUTEINFO shExecInfo;
shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shExecInfo.fMask = NULL;
shExecInfo.hwnd = NULL;
shExecInfo.lpVerb = L"runas";
shExecInfo.lpFile = L"MyApp.exe";
shExecInfo.lpParameters = L"password";
shExecInfo.lpDirectory = NULL;
shExecInfo.nShow = SW_NORMAL;
shExecInfo.hInstApp = NULL;
ShellExecuteEx(&shExecInfo);
return 0;
}
我如何实现这一目标?