HTTP/1.0 200 OK
Date: Tue, 22 Mar 2005 05:39:19 GMT
Server: Apache/2.0.52 (Unix)
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Cache-Control: max-age=300
Expires: Tue, 22 Mar 2005 05:44:19 GMT
Content-Length: 25087
Content-Type: text/html; charset=zh_CN.GB2312
Age: 76
X-Cache: HIT from cachea.china.com
Connection: keep-alive?(57骨蘓?.&謓K?驸薿闠謩?羂倷??V?羶皕E试裚€竊???澵殩笝]v}?鼉訧ю鉃嶝豦?S訇#f逳廉鶜>嵛*fQ惁
7盀=援扲凵
?垌u?艀譮銈幊;3軛&軇щ0<y儳3艹+%1@経铍S2這睏犒撛釤脱u?h3軇⒃(A潄€?縀
???b桀?曝ju:峃想噌?嘒.??Rz鞓(q蹷?狒殸誰? ?穓螨?Pk??g牛/D ?線凲帨皨iEf??啨??A(擫0F?樧?篮傀醑绠婫c?)屃泋憨X$??嵤呹芤鶱癍唿?耦飤+绷K闔镃?l刼p礰?櫺^z憼@穆唩?嶻hwpX?p膻&ge(
蚌陰#/璋?Z痔骹7za4y]澍?n0#?2P灂衼澙?+F窰菭
?仾?;辪Y K戝噮sN?蓮s鱺!o)t`+纫??c) `?縈 e鼹?yk?{A朏綈Fk? 茽3玱?涩-G耴蝣B??!??Ie?[攮-售<]蚄Q郛諙缬'瓰E匍2雿F>;J?閙OW/'婵?璬壟鸻j
*L?V&挒鹦悆^F忱谐A??Bub饎&FmOY7褘摼|煽?21鮸フ磿鑱]Nm翸|&?貅8;??!>7姏绂鸂擣N濡&}渂虼?on*?几kLcwj∟飪sN{
Date: Tue, 22 Mar 2005 05:39:19 GMT
Server: Apache/2.0.52 (Unix)
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Cache-Control: max-age=300
Expires: Tue, 22 Mar 2005 05:44:19 GMT
Content-Length: 25087
Content-Type: text/html; charset=zh_CN.GB2312
Age: 76
X-Cache: HIT from cachea.china.com
Connection: keep-alive?(57骨蘓?.&謓K?驸薿闠謩?羂倷??V?羶皕E试裚€竊???澵殩笝]v}?鼉訧ю鉃嶝豦?S訇#f逳廉鶜>嵛*fQ惁
7盀=援扲凵
?垌u?艀譮銈幊;3軛&軇щ0<y儳3艹+%1@経铍S2這睏犒撛釤脱u?h3軇⒃(A潄€?縀
???b桀?曝ju:峃想噌?嘒.??Rz鞓(q蹷?狒殸誰? ?穓螨?Pk??g牛/D ?線凲帨皨iEf??啨??A(擫0F?樧?篮傀醑绠婫c?)屃泋憨X$??嵤呹芤鶱癍唿?耦飤+绷K闔镃?l刼p礰?櫺^z憼@穆唩?嶻hwpX?p膻&ge(
蚌陰#/璋?Z痔骹7za4y]澍?n0#?2P灂衼澙?+F窰菭
?仾?;辪Y K戝噮sN?蓮s鱺!o)t`+纫??c) `?縈 e鼹?yk?{A朏綈Fk? 茽3玱?涩-G耴蝣B??!??Ie?[攮-售<]蚄Q郛諙缬'瓰E匍2雿F>;J?閙OW/'婵?璬壟鸻j
*L?V&挒鹦悆^F忱谐A??Bub饎&FmOY7褘摼|煽?21鮸フ磿鑱]Nm翸|&?貅8;??!>7姏绂鸂擣N濡&}渂虼?on*?几kLcwj∟飪sN{
解决方案 »
- 各种gui库里的消息转发是怎么做的
- WTL文件类
- 做过google map应用的进
- LOGFONT和CHARFORMAT转化问题
- 一楼安装了一个无线路由器,一楼的每台计算机通过安装无线网卡可以上网,但是我们三楼的计算机用同样的无线网卡确上不了网,谁有办法解决?
- OnPrepareDC()中设置映射模式,当窗口滚动时图形模糊,如何解决啊?
- 请教:工具栏按钮激活问题
- cformview 中的OnInitialUpdate();为什么不初始化我的Clistctl控件(好像没执行)
- 当滚动条滚动时,CTreeCtrl是如何滚动的,
- 在线等待,在自己定义的类中如何访问文档的数据?
- 请问为什么单文档文件一出来就是2个线程?
- 本人写了个dll export函数的程序,供大家参考
sock.Connect(m_url,80);
CString str;
str="GET / HTTP/1.1\r\n";
str+="Accept: image/gif, */*\r\n";
str+="Accept-Language: zh-cn\r\n";
str+="Accept-Encoding: gzip,deflate\r\n";
str+="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)\r\n";
str+="Host:";
str+=m_url;
str+="\r\n";
str+="Connection: Keep-Alive\r\n\r\n";
sock.Send(str,str.GetLength(),0);m_post=str;
CFile fp;
fp.Open("c:\\test.htm",CFile::modeCreate|CFile::modeWrite);
DWORD len=0;
char buf[4096];
memset(buf,0,4096);
len=sock.Receive(buf,4096);
LPSTR head=new char[1024]; memset(head,0,1024);
sscanf(buf,"%[^<]html",head);
m_response=head;
fp.Write(buf,len);
CString html;
CString text;
html.Format("%s",buf);
while(len != 0)
{
text+=html;
memset(buf,0,4096);
len=sock.Receive(buf,4096);
html.Format("%s",buf);
fp.Write(buf,len);
}
char*p=strstr(text,"<html>");
m_rich.SetWindowText(p);
UpdateData(FALSE);
sock.Close();
fp.Close();
2、最好改为
CString html = "";
CString text = "";
3、程序流程没发现问题,但这个程序有些不安全:错误没有判断,异常没有处理
http://news.sina.com.cn/c/2005-03-24/02575445409s.shtml网页
还是出现怪吗!!!
CInternetSession session;
CInternetFile *file=NULL;
try
{
file = (CInternetFile*) session.OpenURL(m_url);
}
catch (CInternetException* m_pException)
{
file = NULL;
m_pException->Delete();
return;
}
CStdioFile dataStore;
if (file)
{
CString somecode;
BOOL bIsOk = dataStore.Open("d:\\default.htm",
CFile::modeCreate
| CFile::modeWrite
| CFile::shareDenyWrite
| CFile::typeText);
if (!bIsOk)
return;
while (file->ReadString(somecode) != NULL)
{
m_text+=somecode;
m_text+="\n";
dataStore.WriteString(somecode);
dataStore.WriteString("\n");
}
file->Close();
delete file;
UpdateData(FALSE);
}
else
{
MessageBox(_T("到指定服务器的连接建立失败..."));
}