需要:连接function GetComputerName (nameBuf)命令的结果以打开Chormium.
目标:使用正在执行安装的计算机的名称创建新的配置文件.
问题:我不知道如何实现这种连接,试图成功完成strcpy并strcat取得成功.
这是我的代码:
int WINAPI WinMain(HINSTANCE inst,HINSTANCE prev,LPSTR cmd,int show)
{
//Close phpdesktop.exe
WinExec("taskkill /F /IM phpdesktop.exe", SW_HIDE);
//Sleep
Sleep(500);
//Open phpdesktop.exe mini server
WinExec("phpdesktop.exe -S 127.0.0.1:54007 -t www -c php.ini", SW_HIDE);
//Sleep
Sleep(500);
//Get computer name
TCHAR nameBuf[MAX_COMPUTERNAME_LENGTH + 2];
DWORD nameBufSize;
nameBufSize = sizeof nameBuf - 1;
if (GetComputerName(nameBuf, &nameBufSize) == TRUE)
{
//How to make the concatenation result nameBuf GetComputerName function with the command of …Run Code Online (Sandbox Code Playgroud)