lem's Blog
以无法为有法,以无限为有限.
登录
注册
全站
当前博客
空间
博客
好友
相册
留言
刘铭
ID:lem12
共
21260
次访问,排名
5386
好友
7
人,关注者
13
人
computer
lem12的文章
原创 32 篇
翻译 7 篇
转载 3 篇
评论 22 篇
刘铭的公告
网站联盟
最近评论
mldstk:
wow gold
,
#:
受益匪浅!!
fanxianshi:
谢谢!
rainwords:
很好,谢谢!
我正好在找这方面的资料^_^
Jack Li:
study
文章分类
.Net
(RSS)
AjaX
(RSS)
FrameWork
(RSS)
JavaScript
(RSS)
SqlServer
(RSS)
共享
(RSS)
文章
(RSS)
收藏
Asp.Net
相册
存档
2008年06月(1)
2008年04月(3)
2008年03月(3)
2008年02月(1)
2008年01月(2)
2007年11月(1)
2007年08月(3)
2007年07月(10)
2007年06月(7)
2007年05月(7)
2007年04月(4)
软件项目交易
订阅我的博客
将google搜索的内容显示在自己的页面上
收藏
新一篇: VS 2005中也可以查看.NET源码
|
旧一篇: 使用页面Gzip压缩提速
效果图
实现代码
protected
void
Button1_Click(
object
sender, EventArgs e)
...
{
Uri u
=
new
Uri(
"
http://www.google.cn/search?q=
"
+
TextBox1.Text
+
"
&hl=zh-CN&ie=GB2312&lr=&nxpt=10.2068337957705091425725
"
);
HttpWebRequest dd
=
(HttpWebRequest)WebRequest.Create(u);
dd.Method
=
"
GET
"
;
WebResponse req
=
dd.GetResponse();
Stream str
=
req.GetResponseStream();
StreamReader readerOfStream
=
new
StreamReader(str, System.Text.Encoding.GetEncoding(
"
GB2312
"
));
string
aa
=
readerOfStream.ReadToEnd();
string
abc
=
""
;
char
aa1
=
(
char
)
13
;
char
aa2
=
(
char
)
10
;
string
Str
=
aa.Replace(aa1.ToString(),
""
).Replace(aa2.ToString(),
""
);
string
StartStr
=
"
<div><div class=g>[变量]
"
;
StartStr
=
StartStr.Replace(
"
[变量]
"
,
"
.*
"
);
string
LastStr
=
"
</div>
"
;
string
SearchStr
=
StartStr
+
"
.*
"
+
LastStr;
Regex re
=
new
Regex(SearchStr, RegexOptions.IgnoreCase);
Match m
=
re.Match(aa);
Response.Write(m.Value);
str.Close();
}
发表于 @
2008年01月15日 10:16:00
|
评论(
loading...
)
|
编辑
新一篇: VS 2005中也可以查看.NET源码
|
旧一篇: 使用页面Gzip压缩提速
评论
#
qijiachao 发表于2008-02-21 23:35:16 IP: 218.4.167.*
请问牛人,我在学习.net,想做一个内容管理系统,可是不知道用什么框架和模式?请指点,我的邮箱是:632766178@qq.com,谢了!
发表评论
姓 名:
主 页:
校验码:
看不清,换一张
登录