找回密码
 立即注册
查看: 1325|回复: 5

[其他源代码] 【源代码】读取贴吧访问人的头像

[复制链接]

121

回帖

619

基友

1167

积分

通神3段 Lv.6

Rank: 3Rank: 3

发表于 2013-12-19 13:56:39 | 显示全部楼层 |阅读模式



private void button1_Click(object sender, EventArgs e)
{

处理();
}
string[] title = new string[] { "", "", "", "", "", "", "", "", "", "", "", "" };
private void 处理()
{

Encoding encoding = Encoding.GetEncoding("gb2312");
string text = new StreamReader(this.webBrowser1.DocumentStream, encoding).ReadToEnd();
string[] s = text.Split(new string[] { "><img src=" }, StringSplitOptions.RemoveEmptyEntries);
string[] b = s[2].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
string[] p = s[1].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
string[] e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox1.ImageLocation = text;
title[0] = e[0];

p = s[2].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[1] = e[0];
b = s[3].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox2.ImageLocation = text;

p = s[3].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[2] = e[0];
b = s[4].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox3.ImageLocation = text;

p = s[4].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[3] = e[0];
b = s[5].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox4.ImageLocation = text;

p = s[5].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[4] = e[0];
b = s[6].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox5.ImageLocation = text;

p = s[6].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[5] = e[0];
b = s[7].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox6.ImageLocation = text;

p = s[7].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[6] = e[0];
b = s[8].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox7.ImageLocation = text;

p = s[8].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[7] = e[0];
b = s[9].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox8.ImageLocation = text;

p = s[9].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[8] = e[0];
b = s[10].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox9.ImageLocation = text;

p = s[10].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[9] = e[0];
b = s[11].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox10.ImageLocation = text;

p = s[11].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[10] = e[0];
b = s[12].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox11.ImageLocation = text;


p = s[12].Split(new string[] { "/home/main?un=" }, StringSplitOptions.RemoveEmptyEntries);
e = p[1].Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
title[11] = e[0];
b = s[13].Split(new string[] { "alt" }, StringSplitOptions.RemoveEmptyEntries);
text = b[0].Substring(1, b[0].Length - 3);
pictureBox12.ImageLocation = text;
}

private void pictureBox_MouseHover(object sender, EventArgs e)
{
PictureBox pb = sender as PictureBox;
toolTip1.SetToolTip(pb, title[int.Parse(pb.Tag.ToString())]);
}

private void pictureBox_MouseLeave(object sender, EventArgs e)
{
toolTip1.RemoveAll();
}

界面图片

界面图片
回复

使用道具 举报

241

回帖

511

基友

731

积分

通神2段 Lv.5

Rank: 3Rank: 3

发表于 2013-12-19 16:56:04 来自手机 | 显示全部楼层
先支持一个
回复 支持 反对

使用道具 举报

1万

回帖

2万

基友

5万

积分

苍海之魂

S̲̅F

Rank: 13Rank: 13Rank: 13Rank: 13

苍海的女仆会员纪念勋章周年纪念勋章

发表于 2013-12-20 11:45:08 | 显示全部楼层
就这样直接写出来了
回复 支持 反对

使用道具 举报

121

回帖

619

基友

1167

积分

通神3段 Lv.6

Rank: 3Rank: 3

 楼主| 发表于 2013-12-20 12:40:11 | 显示全部楼层
雪狐 发表于 2013-12-20 11:45
就这样直接写出来了

已经很多了  基本上就是从网页源码里边 查找的图片的连接  然后显示在图片框里边   
回复 支持 反对

使用道具 举报

427

回帖

431

基友

1585

积分

通神3段 Lv.6

Rank: 3Rank: 3

发表于 2013-12-20 18:49:00 | 显示全部楼层
没看懂嘛意思?
回复 支持 反对

使用道具 举报

430

回帖

7606

基友

6509

积分

萨菲尔斯

Rank: 17Rank: 17Rank: 17Rank: 17Rank: 17

发表于 2013-12-22 01:55:00 | 显示全部楼层
不懂这是啥语言 看起来写的超级复杂 不过目测有数组越界危险
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|苍海国际 ( 鲁ICP备13020644号-1 )

GMT+8, 2024-11-22 12:30 , Processed in 0.063043 second(s), 30 queries .

Powered by Discuz! Theme By eRic Modified by 4bpa

© CangHai International We Do Our Rights!

返回顶部