|
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();
} |
-
界面图片
|