13,825
社区成员
发帖
与我相关
我的任务
分享
//取验证码
IHTMLDocument2 *document;
IHTMLElement *body;
BSTR source;
(void *)document=CppWebBrowser1-> Document;
document->get_body(&body);
body-> get_outerHTML(&source);
String sr=source;
String at="<FONT face=华文新魏 color=#0033cc><STRONG>";
int p=sr.Pos(at);
String yzm=sr.SubString(p+at.Length(),4);
//以下开始登录
Doc = CppWebBrowser1->Document;
all = Doc.OlePropertyGet("all"); //得到腳本的所有物件,具體參考javascript語法
user= all.OlePropertyGet("username");
user.OlePropertySet("innerText","aaa"); //你的用戶名,請寫在此處
pass= all.OlePropertyGet("password");
pass.OlePropertySet("innerText","123456"); //你的密碼,請寫在此處
code=all.OlePropertyGet("confirmcode");
code.OlePropertySet("innerText",(WideString)yzm); //验证码
submit= all.OlePropertyGet("submit"); //登錄
submit.OleFunction("click");