64,654
社区成员
发帖
与我相关
我的任务
分享
char sendBuff[200] = "GET http://blog.csdn.net/sjjwind HTTP/1.0\r\nHost:www.csdn.net\r\n\r\n";
while(TRUE)
{
memset(pBuffer,0,1026);
nRet = recv(sock,pBuffer,1024,0);
if(nRet == 0 || nRet == SOCKET_ERROR)
{
break;
}
DWORD dwUnicodeLen = MultiByteToWideChar(CP_UTF8,0,pBuffer,-1,NULL,0 );
WCHAR* pwText = new WCHAR[dwUnicodeLen + 1];
memset(pwText,0,(dwUnicodeLen + 1) * sizeof(WCHAR));
if ( dwUnicodeLen > 0)
{
MultiByteToWideChar(CP_UTF8,0,pBuffer,-1,pwText,dwUnicodeLen);
}
wprintf(pwText);
}
HTTP/1.1 200 OK
Server: nginx/0.7.68
Date: Mon, 06 Aug 2012 23:41:21 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Vary: Accept-Encoding
X-Powered-By: ASP.NET
Set-Cookie: uuid=c79666aa-2779-4dba-b893-3268957c6e14; expires=Tue, 07-Aug-2012 23:37:04 GMT; path=/
Cache-Control: public, no-store, max-age=60
Expires: Mon, 06 Aug 2012 23:38:04 GMT
Last-Modified: Mon, 06 Aug 2012 23:37:04 GMT
Vary: *
Content-Length: 44731
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YHC@HC - s" type="text/javascript"></script>
<link rel="Stylesheet" type="text/css" href="http://static.blog.csdn.net/skin/ink/css/style.css" />
<link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="/yhc13429826359/rss/list" />
<link rel="shortcut icon" href="/favicon.ico" />
<link type="text/css" rel="stylesheet" href="http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/default.css" />
</head>
<body>
<script src="http://csdnimg.cn/pubnav/js/pub_topnav_2011.js"type="text/javascript"></script>
<div id="container">
<div id="header">
<div class="header">
<div id="blog_title">
<h1><a href="/yhc13429826359">YHC@HC</a></h1>
<h2>no pain no gain</h2>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="navigator">
<div class="navigator_bg"></div>
<div class="navigator">
<ul>
<li id="btnContents"><a href="?viewmode=contents"><span><img src="http: //static.blog.csdn.net/images/ico_list.gif"> target="_blank"><font color=red> easyUI 1.3 <div class="list_item article_item">
<div class="article_title">
<span class="ico ico_type_Original"></span>
<h3>
<span class="link_title"><a href="/yhc13429826359/article/details/7796033">
<font color="red">[/www.eclipse.org/mat/dow... </div>
<div class="article_manage">
<span class="link_postdate">2012-07-03 15:22</span>
<span class="link_view" title="t.application({
name: 'MyApp',
launch: function() {
Ext.create('Ext.container.Viewport', {
it... </div>
<div class="article_manage">
<span class="link_postdate">2012-08-06 17:29</span>
<span class="link_view" title="60; // ption">
@author YHC
9826359/article/details/7834492">
easyUI SearchBox
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
ion">
@author YHC
<span class="link_title"><a href="/yhc13429826359/article/details/7834095">
easyUI Droppable
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
itle">
<span class="ico ico_type_Translated"></span>
<h3>
<span class="link_title"><a href="/yhc13429826359/article/details/7832169">
easyUI Draggable
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
le
title
$('#dd').draggable({
handle:'#title'
});
easyloader.load('messager', function(){ // lated"></span>
<h3>
<span class="link_title"><a href="/yhc13429826359/article/details/7827685">
easyUI Tree
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
</div>
<div class="list_item article_item">
<div class="article_title">
<span class="ico ico_type_Translated"></span>
<h3>
<span class="link_title"><a href="/yhc13429826359/article/details/7827554">
easyUI PropertyGrid
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
aults
propertygrid
h3>
</div>
<div class="article_description">
@author YHC
<span class="ico ico_type_Translated"></span>
<h3>
<span class="link_title"><a href="/yhc13429826359/article/details/7825753">
easyUI Messager
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
</div>
<div class="list_item article_item">
<div class="article_title">
<span class="ico ico_type_Translated"></span>
<h3>
<span class="link_title"><a href="/yhc13429826359/article/details/7823702">
easyUI Dialog
</a></span>
</h3>
</div>
<div class="article_description">
@author YHC
"><a href="/yhc13429826359/article/details/7823702#comments" title="a href="/yhc13429826359/article/details/7823566" title="der
<i... </div>
<div class="article_manage">
<span class="link_postdate">2012-08-02 16:11</span>
<span class="link_view" title="0;$.fn.numberspinner.defaults
numberspinner
alidatebox.defaults.<a href="/yhc13429826359/article/list/4">4</a> <a href="/yhc13429826359/article/list/5">5</a> <a href="/yhc13429826359/article/list/6">...</a> <a href="/yhc13429826359/article/list/2"></a>
<a href="http://my.csdn.net/my/letter/send/yhc13429826359" class="letter" title="[odeURIComponent(_blogger) + "?jsonpcallback=?";
$.getJSON(url, {}, function (data) {
if (data.succ == 1 && data.info == 1) {
$('#span_add_follow').attr('class', 'attented');
} else {
$('#span_add_follow').click(guanzhu);
}
}, 'json');
}
});
function guanzhu() {
var url = "http://my.csdn.net/index.php/follow/do_follow?jsonpcallback=?";
$.getJSON(url, { "username": _blogger }, function (data) {
if (data.succ == 1) {
alert(';|$)"));
if (m) return m[2];
else return '';
}
</script>
<div class="panel" id="panel_Search">
<ul class="panel_head"><span>div id="panel_Category" class="panel">
<ul class="panel_head"><span>icle/month/2012/06">2012articls" class="panel">
<ul class="panel_head"><span>/a><span>(786)</span>
</li>
<li>
<a href="/yhc13429826359/article/details/7434924" title="eclipse </span></ul>
<ul class="panel_body itemlist">
<li>
<a href="/yhc13429826359/article/details/7363723" title="JAVA," title="POI Excel 06
<li>
<a href="/yhc13429826359/article/details/7825753#comments">easyUI Messager</a>
<p style="margin:0px;">JohnnyDengy:
</p>
</li>
<li>
<a href="/yhc13429826359/article/details/7825753#comments">easyUI Messager</a>
<p style="margin:0px;">ligenhualear:
ipt type="text/javascript">document.write("<img src=http://counter.csdn.net/pv.aspx?id=26 border=0 width=0 height=0>");</script>
<script type="text/javascript" src="http://csdnimg.cn/pubfooter/js/publib_footer.js"></script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/Csdn/counter.js"></script>
</div>
</body>
</html>
试过
GET /sjjwind HTTP/1.0
Host:blog.csdn.net
和
GET http://blog.csdn.net/sjjwind HTTP/1.0
Host:www.csdn.net
两个都没有问题, 收到的数据
Trying 117.79.93.222...
Connected to blog.csdn.net.
Escape character is '^]'.
HTTP/1.1 200 OK
Server: nginx/0.7.68
Date: Mon, 06 Aug 2012 17:16:05 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Vary: Accept-Encoding
X-Powered-By: ASP.NET
Set-Cookie: uuid=6c66a321-8b34-4771-9ec1-e4d04955df32; expires=Tue, 07-Aug-2012 17:11:48 GMT; path=/
Cache-Control: public, no-store, max-age=60
Expires: Mon, 06 Aug 2012 17:12:48 GMT
Last-Modified: Mon, 06 Aug 2012 17:11:48 GMT
Vary: *
Content-Length: 12383
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sjjwind的专栏 - 博客频道 - CSDN.NET</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />