C#开发的一个查看QQ秀软件

使用网络流开发,代码很短,有兴趣的看看:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.forms;
using System.Data;

namespace QQ秀扫描器
{
       
/// <summary>
       
/// form1 的摘要说明。
       
/// </summary>

       public class form1 : System.Windows.forms.form
       
{
               
private System.Windows.forms.Label label1;
               
private System.Windows.forms.TextBox textBox1;
               
private System.Windows.forms.PictureBox pictureBox1;
               
private System.Windows.forms.Button button1;
               
private System.Windows.forms.Button button2;
               
private System.Windows.forms.Label label2;
               
private System.Windows.forms.LinkLabel linkLabel1;
               
/// <summary>
               
/// 必需的设计器变量。
               
/// </summary>

               private System.ComponentModel.Container components = null;

               
public form1()
               
{
                       
//
                       
// Windows 窗体设计器支持所必需的
                       
//
                       InitializeComponent();

                       
//
                       
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
                       
//
               }


               
/// <summary>
               
/// 清理所有正在使用的资源。
               
/// </summary>

               protected override void Dispose( bool disposing )
               
{
                       
if( disposing )
                       
{
                               
if (components != null
                               
{
                                       components.Dispose();
                               }

                       }

                       
base.Dispose( disposing );
               }


               
Windows 窗体设计器生成的代码

               
/// <summary>
               
/// 应用程序的主入口点。
               
/// </summary>

               [STAThread]
               
static void Main() 
               
{
                       Application.Run(
new form1());
               }

               
//以上代码为vs.net自动生成
               
//以下代码才是手写代码
               string usenum="";
               
private void button1_Click(object sender, System.EventArgs e)
               
{
                       
int thenum=0;
                       
string numstr="";
                       
try
                       
{
                               thenum
=int.Parse(this.textBox1.Text);
                               
switch(this.textBox1.Text.Length)
                               
{
                                       
case 9:
                                               numstr
=this.textBox1.Text;
                                               
break;
                                       
case 8:
                                               numstr
="0"+this.textBox1.Text;
                                               
break;
                                       
case 7:
                                               numstr
="00"+this.textBox1.Text;
                                               
break;
                                       
case 6:
                                               numstr
="000"+this.textBox1.Text;
                                               
break;
                                       
case 5:
                                               numstr
="0000"+this.textBox1.Text;
                                               
break;
                                       
default:
                                               MessageBox.Show(
"请输入正确的号码!");
                                               
break;
                               }

                       }

                       
catch
                       
{
                               MessageBox.Show(
"请输入正确的号码!");
                       }

                       
try
                       
{
                               
int next=thenum+1;
                               
this.textBox1.Text=next.ToString();
                               
this.usenum=numstr;
                               System.Net.WebRequest req 
=System.Net.WebRequest.Create("http://qqshow-user.tencent.com/"+numstr+"/10/00/");
                               System.Net.WebResponse res 
= req.GetResponse();
                               System.IO.Stream red 
= res.GetResponseStream();
                               
this.pictureBox1.Image=System.Drawing.Image.FromStream(red);
                               red.Close();
                               res.Close();
                               
this.label2.Text=numstr;                                
                       }

                       
catch
                       
{
                               
this.label2.Text="出错,请查下一个。";
                       }

               }


               
private void button2_Click(object sender, System.EventArgs e)
               
{
                       
if(!System.IO.Directory.Exists(Application.StartupPath+"\savefile"))
                       
{
                               System.IO.Directory.CreateDirectory(Application.StartupPath
+"\savefile");
                       }

                       
this.pictureBox1.Image.Save(Application.StartupPath+"\savefile\"+usenum+".gif",System.Drawing.Imaging.Imageformat.Gif);
               }


               
private void linkLabel1_LinkClicked(object sender, System.Windows.forms.LinkLabelLinkClickedEventArgs e)
               
{
                       System.Diagnostics.Process.Start(
"www.anxsoft.com");
               }
                
       }

}

 

下载地址







posted on 2004-07-07 14:53  ╋上帝已死,ICE已重生╋  阅读(847)  评论(0)    收藏  举报

导航