用户:天马神坑_真查看:0 回复:3 评论:0 创建时间:2019-07-27T19:23:43
如何用C++用默认浏览器打开一个网页,大佬快来帮忙
希望大佬给出一个实例
例如:
输入一个编程猫作品id,打开相应网页
大佬们,快来帮忙啊
#include <iostream>
#include <string>
using namespace std;
int main(){
string url = "你要打开的网址";
ShellExecute(NULL, _T("open"), _T("explorer.exe"), _T("<a target=_blank href=url target="_blank" rel="nofollow" style="color:rgb(45,100,179); text-decoration:none">url</a>"), NULL, SW_SHOW);
return 0;
}
点赞1
评论
#include<iostream> // 设定源文件
#include<string.h>
using namespace std; //声明命名空间
int main() //设置入口
{
system("title Powerd by Zhetengtiao"); //设置标题
char a[10]; //定义字符串变量
cout<<"Set Codemao-Kitten ID"<<endl;
cout<<"设定编程猫作品ID"<<endl; //中文提示
cin>>a; //设置ID
char b[]="start https://ide.codemao.cn/we/"; //定义字符型变量为链接命令
strcat(b,a); //将两个字符串变量连在一起
system(b); //执行命令
return 0; //退出
}
拿去~
点赞0
评论