寻求网站自动登录的方法或源码? 我想作一个能自动登录网站指定页面的小东东,比如能每天自动--》登录CSDN,输入账号,更新我的个人信息等...... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以下形成html文件就可<html><head><title>net fava</title><body><form method="POST" action="http://expert.csdn.net/member/logon.asp" target="_top" name="alogon"> <input type="text" name="name" size="7" value=""> <input type="password" name="pass" size="7" value=""> <select name="type" size="1" style="background-color:#006699;color:#ffffff"> <option value="1" selected>我的论坛</option> <option value="2">我的软件</option> <option value="3">我的订单</option> <option value="4">我的文档</option> <option value="5">我的简历</option> </select> <input type="image" src="http://www.csdn.net/images/index_login1.gif"></form></body></html>在两个value的地方填写你的用户名和密码即可如果想用C的话,可以用编个以上的网页在webbrowser或是直接发送http请求都可 如果想控制IE中的提交,参照如下:void CGetIESrcDlg::NavigateToUrl(){ // Import the following files in your stdafx.h// #import <mshtml.tlb> // Internet Explorer 5// #import <shdocvw.dll>// Refer to "Connect to Internet Explorer Instances, From your own Process. " in www.codeguru.com SHDocVw::IShellWindowsPtr m_spSHWinds; CoInitialize(NULL); if(m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) == S_OK) { IDispatchPtr spDisp; long nCount = m_spSHWinds->GetCount(); for (long i = 0; i < nCount; i++) { _variant_t va(i, VT_I4); spDisp = m_spSHWinds->Item(va); SHDocVw::IWebBrowser2Ptr spBrowser(spDisp); if (spBrowser != NULL) { IDispatchPtr spDisp; if(spBrowser->get_Document(&spDisp) == S_OK && spDisp!= 0 ) { MSHTML::IHTMLDocument2Ptr spHtmlDocument(spDisp); MSHTML::IHTMLElementPtr spHtmlElement; if(spHtmlDocument==NULL) continue; spHtmlDocument->get_body(&spHtmlElement); if(spHtmlDocument==NULL) continue; HRESULT hr; MSHTML::IHTMLElementCollection* pColl=NULL; hr=spHtmlDocument->get_all(&pColl); if(pColl!=NULL&&SUCCEEDED(hr)) { MSHTML::IHTMLElement* pElem=NULL; _variant_t index; index.vt=VT_I4; index.intVal=0; _variant_t name("Submit"); IDispatchPtr disp; disp=pColl->item(name,index); if(disp==NULL) hr=E_FAIL; else { hr=disp->QueryInterface(&pElem); } if (SUCCEEDED(hr)&& pElem != NULL) { // BSTR bstrhtml; pElem->get_outerHTML(&bstrhtml); CString str(bstrhtml); AfxMessageBox(str); pElem->click(); pElem->Release(); } pColl->Release(); } } } } } else { AfxMessageBox("Shell Windows interface is not avilable"); } CoUninitialize();} VC里面编译一个RCa开头的文件,而且有200多M,.rc文件也是100多M,很慢,怎么办? 进程端口关联问题。(请高手指点) ListBox控件的一个问题 MDI-多视图的实现 WebBrowser的问题?(二) 如何根据应用程序句柄得到其主窗口的句柄? 怎么样给Activex控件签名? 下面是个得到本机的计算机名,但奇怪的事情终于发现了........请各位参加,UP都有分! 菜鸟系列:请问如何用VC下载一个URL的HTML文档?急急急!!!!!!!!! 请问除了csdn外还有什么技术论坛??? 在VC中如何运行chm文件?? 怎么用控制台命令查看进程,并终止进程?
<html>
<head>
<title>net fava</title>
<body><form method="POST" action="http://expert.csdn.net/member/logon.asp" target="_top" name="alogon">
<input type="text" name="name" size="7" value="">
<input type="password" name="pass" size="7" value="">
<select name="type" size="1" style="background-color:#006699;color:#ffffff">
<option value="1" selected>我的论坛</option>
<option value="2">我的软件</option>
<option value="3">我的订单</option>
<option value="4">我的文档</option>
<option value="5">我的简历</option>
</select>
<input type="image" src="http://www.csdn.net/images/index_login1.gif">
</form>
</body>
</html>
在两个value的地方填写你的用户名和密码即可
如果想用C的话,可以用编个以上的网页在webbrowser或是直接发送http请求都可
void CGetIESrcDlg::NavigateToUrl()
{
// Import the following files in your stdafx.h
// #import <mshtml.tlb> // Internet Explorer 5
// #import <shdocvw.dll>
// Refer to "Connect to Internet Explorer Instances, From your own Process. " in www.codeguru.com
SHDocVw::IShellWindowsPtr m_spSHWinds;
CoInitialize(NULL);
if(m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) == S_OK)
{
IDispatchPtr spDisp;
long nCount = m_spSHWinds->GetCount();
for (long i = 0; i < nCount; i++)
{
_variant_t va(i, VT_I4);
spDisp = m_spSHWinds->Item(va);
SHDocVw::IWebBrowser2Ptr spBrowser(spDisp);
if (spBrowser != NULL)
{
IDispatchPtr spDisp;
if(spBrowser->get_Document(&spDisp) == S_OK && spDisp!= 0 )
{
MSHTML::IHTMLDocument2Ptr spHtmlDocument(spDisp);
MSHTML::IHTMLElementPtr spHtmlElement;
if(spHtmlDocument==NULL)
continue;
spHtmlDocument->get_body(&spHtmlElement);
if(spHtmlDocument==NULL)
continue;
HRESULT hr;
MSHTML::IHTMLElementCollection* pColl=NULL;
hr=spHtmlDocument->get_all(&pColl);
if(pColl!=NULL&&SUCCEEDED(hr))
{
MSHTML::IHTMLElement* pElem=NULL;
_variant_t index;
index.vt=VT_I4;
index.intVal=0;
_variant_t name("Submit");
IDispatchPtr disp;
disp=pColl->item(name,index);
if(disp==NULL)
hr=E_FAIL;
else
{
hr=disp->QueryInterface(&pElem);
}
if (SUCCEEDED(hr)&& pElem != NULL)
{
//
BSTR bstrhtml;
pElem->get_outerHTML(&bstrhtml);
CString str(bstrhtml);
AfxMessageBox(str);
pElem->click();
pElem->Release();
}
pColl->Release();
}
} }
} }
else {
AfxMessageBox("Shell Windows interface is not avilable");
}
CoUninitialize();
}