小白一只,求支援

C++语言 码拜 8年前 (2016-04-28) 807次浏览
#include <shellapi.h>
#include <windows.h>
main()
{
ShellExecute(NULL, _T(“open”), _T(“explorer.exe”), _T(“http://www.baidu.com”), NULL, SW_SHOW);
}
本人想用VC编写一个访问网页的程序,以上是根据各贴吧论坛人们说的写出来的,请教大家还要怎么写,才能实现?就是用默认浏览器访问百度,最好能有完整的代码,在此谢过大家了!
解决方案

20

#include <windows.h>
#include <shellapi.h>
int main()
{
	ShellExecute(NULL, _T("open"), _T("explorer.exe"), _T("http://www.baidu.com"), NULL, SW_SHOW);
	return 0;
}

亲测可用

20

ShellExecute(NULL, “open”, “http://www.baidu.com”, NULL, NULL, SW_SHOWNORMAL);

system(“explorer http://www.baidu.com”);

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明小白一只,求支援
喜欢 (0)
[1034331897@qq.com]
分享 (0)