如何在windows中从c++程序打开url
How to open a url from a c++ program in windows?
我想让我的c++代码打开一个url。然而,所有在线线程都在使用已指定url的ShellExecute。我的代码要求用户输入url,然后程序必须在浏览器中打开它,因此url是字符串的形式。感谢。
我相信这对你来说很有用,当然,如果你使用的是Windows:
std::cout<<"Enter the link: ";
std::string link;
std::cin>>link;
ShellExecute(NULL, "open", link.c_str(), NULL, NULL, SW_SHOWNORMAL);
像这样:
std::string myUrl;
std::cin >> myUrl;
system(std::string("start " + myUrl).c_str());
?
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- C++,系统无法执行指定的程序
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 重载操作程序时出错>>用于类中的字符串 memebr
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 试图在visual studio上用C++创建一个桌面应用程序
- 模板元程序查找相似的连续类型名称
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 如何通过cpp程序运行shell脚本
- 当我读取一个大小为 17 mb 的 100 万个 url 文件时,我的程序占用大小为 163 MB
- 如何启动文件/目录/URL的关联应用程序
- 在 Linux 上的 Qt 中获取应用程序图标 URL
- 如何在windows中从c++程序打开url
- 在Ubuntu Qt应用程序中从Firefox浏览器获取URL
- 如何在linux下使用c++程序从远程url获取数据
- 命令行应用程序的自定义URL方案
- 在Qt应用程序中单击外部浏览器上的按钮打开url
- 调用 SetWindowsHookEx() 的应用程序可以捕获自动完成 URL 和密码吗?