为什么C语言无法打开网页

来源:百度知道 编辑:UC知道 时间:2024/06/20 06:02:23
#include<windows.h>
void main()
{
WinExec("C:\\Program Files\\Internet Explorer\\IExplore.exe http://www.baidu.com",1);
}
程序编译可过,但运行时出现错误提示// 运行时错误-2147467259(80004005)automation

1、打开指定网页,可以有很多方式,比如shellexecute函数就可以直接打开你需要的网页。
关于登陆用户名密码,个人感觉应该是循环遍历当前页面的所有控件,根据控件名,来选择登陆和密码输入框。至于验证码,这个问题,解决难度有点高。暂时没想到什么好的方式,如果没错的话,应该是引用三方插件,或者是对图片进行分析。要求相对比较高。

2、参考代码如下:

#include <windows.h>
int main(void)
{
    ShellExecute(NULL, "open", "
, NULL, NULL, SW_MINIMIZE);
    return 0;
}

你去掉http://
并且你写错了。。
是这样的。。
#include<dos.h>
#include<stdio.h>
main()
{system("\"c:\\program files\\internet explorer\\iexplore.exe\" www.baidu.com");}

可以编译,可以运行

winxp + lcc