无法在C++中启动网站
Can't launch website in C++
尝试在Visual C++ 2010 Express中启动网站,每个研究的解决方案都没有奏效。所以我收集我需要更深入的帮助。这是我的代码:
#include <stdafx.h>
#include <stdio.h>
#include <iostream>
#include <io.h>
#include <string>
#include <string.h>
#include <conio.h>
#include <windows.h>
using namespace System;
using namespace std;
int main()
{
char name[240];
cout<<"nHello, Please enter your name: ";
cin.getline(name,240);
cout<<"nHello "<<name <<", your ID has been confirmed!";
cout<<"nContinuing to launch website 'xyz' now.";
// system("C:\Program%Files\Google\Chrome\Application\chrome.exe");
ShellExecute, TEXT("open"), TEXT(c:\program
files\google\chrome\application\chrome.exe), NULL, NULL, SW_SHOWNORMAL;
goto end;
end:
cout<<"nnProgram completed, Pess any key to exit. ";
_getch();
return 0;
}
像这样。
ShellExecute(NULL, TEXT("open"), TEXT("c:\program files\google\chrome\application\chrome.exe"), NULL, NULL, SW_SHOWNORMAL);
您的路径中缺少参数,缺少双引号,并且很可能在"程序"和"文件"之间有虚假字符。您还缺少 ShellExecute 的参数。
阅读一本书并学习最少C++语法将是一个好主意。这些都是非常基本的错误。
system(""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://heise.de");
为我工作。请参阅如何使用参数调用外部程序?
相关文章:
- 如何创建一个空的全局类并在启动时实例化它
- 即使我读取了所有内容,在FIFO上打开的QSocketNotifier也会一直启动
- 如何使用url确定网站协议
- 使用 std::string () const 函数启动线程或未来
- 如何修复valgrind启动时的致命错误(与libc6-dbg和libc6-dbg:i386连接)
- 将向量作为类>(值)<向量启动和向量<类>[值]有什么区别
- 如何创建线程序列以按照启动顺序执行任务?
- WINAPI 注册应用程序重新启动时不清除打开的套接字
- 在挂钩启动新线程时解除挂钩进程
- 程序无法启动,因为缺少 libmpc-3.dll
- 从 exe 文件 (Visual Studio ) 启动时调试断言失败
- 如何从网站获取数据并将其传输到数据库?
- QSerialPort 在应用程序启动之前正在使用中
- 无法在 Arch Linux 中启动虚幻引擎 4
- C++关于指针和使用函数将它们启动到堆的行为究竟是什么?
- 如何使用 ctypes 停止和重新启动从 Python 运行的C++代码
- 程序在使用 system() 启动另一个可执行文件时停止
- Qt 和 Android - 如何使用 Qandroidjniobject 启动相机
- Q没有管理权限的 exe 无法启动维护工具
- 无法在C++中启动网站