下载sina微博的图片的代码

2015-12-05 09:04:45  访问(3129) 赞(0) 踩(0)

  • // sina微博首先显示的是迷你图,同地址切换后是大图 //
    // 本代码实现对大图的下载 //

    // .cs

    using System;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Reflection;
    using System.IO;
    using SlowX.DevExPress.Infos;
    using System.Data;
    using SlowX.WebManage.Classes.Globals;
    using SlowX.WebManage.Helpers;
    using SlowX.CallInfo.CallClasses.CallPowers;
    using SlowX.CallInfo.CallClasses.CallInfos.WebLib.Tools;
    using SlowX.CallInfo.CallClasses.ResultInfos.WebLib.Tools;
    using SlowX.CallInfo.Model;
    using System.Collections.Generic;
    using SlowX.WebManage.Common;
    using SlowX.WebManage.Classes.Util;
    using SlowX.CallInfo.CallClasses.CallInfos.BAs;
    using SlowX.CallInfo.CallClasses.ResultInfos.BAs;
    using Aspose.Words;
    using System.Diagnostics;
    using SlowX.WebManage.Utils;
    using SlowX.WebManage.Classes.ThreadClasses;
    using System.Threading;
    using SlowX.WebManage.Classes.ClassInfos;
    using SlowX.CallInfo.Common;
    using SlowX.CallInfo.CallClasses.CallInfos.WebLib.Codes;
    using SlowX.CallInfo.CallClasses.ResultInfos.WebLib.Codes;
    using SlowX.CallInfo.CallClasses.CallInfos.WebLib.Imgs;
    using SlowX.CallInfo.CallClasses.ResultInfos.WebLib.Imgs;
    using System.Collections.Specialized;
    using System.Net;


    namespace SlowX.WebManage.UserControls.Admin.Apps.DownSinaWeiBoImage
    {
    /// <summary>
    /// 下载sina微博的图片的代码
    /// </summary>
    public partial class MainList
    :
    UserControl
    {
    #region 内联的Grid索引

    /// <summary>
    /// 内联的Grid索引函数
    /// </summary>
    internal class mainGridIndex
    {
    /// <summary>
    /// Grid的字段索引
    /// </summary>
    public readonly static mainGridIndex instance
    =
    new mainGridIndex();

    /// <summary>
    /// Grid的字段索引
    /// </summary>
    public mainGridIndex()
    {
    int idx = 0;
    m__RowNumber = idx++;
    m_FileUrl = idx++;
    m_EmImageFileSizeV = idx++;


    }



    /// <summary>
    /// _RowNumber
    /// </summary>
    protected int m__RowNumber = -1;

    /// <summary>
    /// _RowNumber
    /// </summary>
    public int _RowNumber
    {
    get
    {
    return m__RowNumber;
    }
    }




    /// <summary>
    /// FileUrl
    /// </summary>
    protected int m_FileUrl = -1;

    /// <summary>
    /// FileUrl
    /// </summary>
    public int FileUrl
    {
    get
    {
    return m_FileUrl;
    }
    }



    /// <summary>
    /// EmImageFileSizeV
    /// </summary>
    protected int m_EmImageFileSizeV = -1;

    /// <summary>
    /// EmImageFileSizeV
    /// </summary>
    public int EmImageFileSizeV
    {
    get
    {
    return m_EmImageFileSizeV;
    }
    }

    }

    #endregion 内联的grid索引


    /// <summary>
    ///
    /// </summary>
    public AppCallHelper _ach
    {
    get
    {
    return AppCallHelper.instance;
    }
    }

    /// <summary>
    ///
    /// </summary>
    public GlobalData _gd
    {
    get
    {
    return GlobalData.instance;
    }
    }

    /// <summary>
    ///
    /// </summary>
    public CallPowerInfo cpiV
    {
    get
    {
    return GlobalData.instance.cpi;
    }
    }

    /// <summary>
    /// 模版
    /// </summary>
    public string CtrlTitle
    {
    get
    {
    return "下载sina的图片";
    }
    }

    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    public UserControl ReCreate()
    {
    return new MainList();
    }

    /// <summary>
    ///
    /// </summary>
    public MainList()
    {
    InitializeComponent();

    try
    {
    StringBuilder formToolTipText = new StringBuilder();
    formToolTipText.AppendLine("下载sina的图片");
    formToolTipText.AppendLine("控件Assembly:" + this.GetType().Assembly.FullName);
    formToolTipText.AppendLine("控件地址:" + this.GetType().FullName);


    toolStripDropDownButton_Title.Text = "下载sina的图片";
    toolStripDropDownButton_Title.ToolTipText = formToolTipText.ToString();

    toolStripSeparator_HomePage.Visible = false;
    toolStripButton_HomePage.Visible = false;

    //宽度和高度值必须大于等于1且不超过256
    ImageList iList = new ImageList();
    iList.ImageSize = new Size(1, 24);

    //这样的结果在第一列的前面多出了1个分量的宽,所有行的高度为24
    this.listView_Main.SmallImageList = iList;
    }
    catch (Exception err)
    {
    MsgForm.MsgException(err);
    }
    }


    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void MainList_Load(object sender, EventArgs e)
    {
    try
    {

    }
    catch (Exception err)
    {
    MsgForm.MsgShowDialog(err.Message);
    }
    }



    #region 封装的方法


    /// <summary>
    /// 设置独立form的控件可见状态
    /// </summary>
    /// <param name="bFlag"></param>
    public void wwwSlowXnetSetVisible(bool bFlag)
    {
    关闭所有ToolStripMenuItem.Visible = bFlag;
    除此之外全部关闭ToolStripMenuItem.Visible = bFlag;

    // toolStripSeparator_HomePage.Visible = !bFlag;
    toolStripButton_HomePage.Visible = !bFlag;
    }

    /// <summary>
    /// 打开网站
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripButton_HomePage_Click(object sender, EventArgs e)
    {
    System.Diagnostics.Process.Start("http://www.slowx.net");
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void 刷新ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    try
    {
    RefleshCtrl();
    }
    catch (Exception err)
    {
    MsgForm.MsgShowDialog(err.Message);
    }
    }



    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void 关闭ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    try
    {
    FormTitleClose();
    }
    catch (Exception err)
    {
    MsgForm.MsgShowDialog(err.Message);
    }
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void 关闭所有ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    try
    {
    FormTitleCloseAll();
    }
    catch (Exception err)
    {
    MsgForm.MsgShowDialog(err.Message);
    }
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void 除此之外全部关闭ToolStripMenuItem_Click(object sender, EventArgs e)
    {
    try
    {
    FormTitleCloseOthers();
    }
    catch (Exception err)
    {
    MsgForm.MsgShowDialog(err.Message);
    }
    }


    /// <summary>
    /// 刷新
    /// </summary>
    public void RefleshCtrl()
    {

    UserControl uc = ReCreate();

    if (uc == null)
    return;

    uc.Dock = DockStyle.Fill;
    Control pCtrl = this.Parent;

    pCtrl.Controls.Clear();
    pCtrl.Controls.Add(uc);
    }


    /// <summary>
    /// 获得TabControl
    /// </summary>
    /// <returns></returns>
    public TabPage GetTabPage(Control cItem)
    {

    while (true)
    {
    if (cItem.Parent == null)
    break;

    if (cItem.Parent is TabPage)
    return cItem.Parent as TabPage;

    cItem = cItem.Parent;
    }

    return null;
    }


    /// <summary>
    /// 获得TabControl
    /// </summary>
    /// <returns></returns>
    public TabControl GetTabControl(Control cItem)
    {
    while (true)
    {
    if (cItem.Parent == null)
    break;

    if (cItem.Parent is TabControl)
    return cItem.Parent as TabControl;

    cItem = cItem.Parent;
    }

    return null;
    }

    /// <summary>
    ///
    /// </summary>
    protected void FormTitleClose()
    {
    TabPage tp = GetTabPage(this);

    if (tp == null)
    {
    Form theForm = this.FindForm();

    if (theForm != null)
    theForm.Close();

    return;
    }

    TabControl tabCtrl = GetTabControl(tp);

    if (tabCtrl != null)
    tabCtrl.TabPages.Remove(tp);

    }

    /// <summary>
    ///
    /// </summary>
    protected void FormTitleCloseAll()
    {

    TabPage tp = GetTabPage(this);

    if (tp == null)
    return;

    TabControl tabCtrl = GetTabControl(tp);

    if (tabCtrl == null)
    return;

    int iCount = tabCtrl.TabPages.Count;

    tp = null;

    for (int j = iCount - 1; j >= 0; --j)
    {
    tp = tabCtrl.TabPages[j];

    if (tp == null)
    continue;

    if (tp.Tag != null && tp.Tag.ToString() == "0")
    continue;

    tabCtrl.TabPages.RemoveAt(j);
    tp.Dispose();
    }

    }


    /// <summary>
    ///
    /// </summary>
    protected void FormTitleCloseOthers()
    {

    TabPage tpCur = GetTabPage(this);

    if (tpCur == null)
    return;

    TabControl tabCtrl = GetTabControl(tpCur);

    if (tabCtrl == null)
    return;

    int iCount = tabCtrl.TabPages.Count;

    TabPage tp = null;

    for (int j = iCount - 1; j >= 0; --j)
    {
    tp = tabCtrl.TabPages[j];

    if (tp == null)
    continue;

    if (tp == tpCur)
    continue;

    if (tp.Tag != null && tp.Tag.ToString() == "0")
    continue;

    tabCtrl.TabPages.RemoveAt(j);
    tp.Dispose();
    }
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripMenuItem_打开程序所在目录_Click(object sender, EventArgs e)
    {
    try
    {
    Assembly ass = this.GetType().Assembly;

    FileInfo theInfo = new FileInfo(ass.Location);

    System.Diagnostics.Process.Start("explorer.exe", theInfo.Directory.FullName);
    }
    catch (Exception err)
    {
    MsgForm.MsgShowDialog(err.Message);
    }
    }

    #endregion 封装的方法


    /// <summary>
    ///
    /// </summary>
    /// <param name="sA"></param>
    /// <returns></returns>
    public List<SinaWeiBoImageDownInfo> SinaWeiBoImageDownInfoListBuild(string[] sA)
    {
    List<SinaWeiBoImageDownInfo> theResult = new List<SinaWeiBoImageDownInfo>();

    string strTmp = null;
    SinaWeiBoImageDownInfo info = null;

    SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize[]
    emA
    =
    SlowX.WebManage.Enums.ImageFileSize.EmArray;

    SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize curEm
    =
    SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.缺省;


    string curTheCode = "";
    string toTheCode = "";

    foreach (string s in sA)
    {
    if (s == null||s.Length ==0)
    continue;

    strTmp = s.Trim();

    if (strTmp.Length == 0)
    continue;

    curEm = EmImageFileSizeGet(strTmp);

    if (curEm == SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.缺省)
    {
    info = new SinaWeiBoImageDownInfo();
    info.FileUrl = strTmp;
    info.EmImageFileSizeV = curEm;
    theResult.Add(info);

    continue;
    }

    curTheCode = SlowX.WebManage.Enums.ImageFileSize.TheCodeGetByEnum(curEm);

    foreach (SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize em in emA)
    {
    if (em == SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.缺省)
    continue;

    info = new SinaWeiBoImageDownInfo();

    if (em == curEm)
    {
    info.FileUrl = strTmp;
    }
    else
    {
    toTheCode = SlowX.WebManage.Enums.ImageFileSize.TheCodeGetByEnum(em);
    info.FileUrl = strTmp.Replace("/" + curTheCode + "/", "/" + toTheCode + "/");
    }

    info.EmImageFileSizeV = em;
    theResult.Add(info);
    }

    }

    return theResult;
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="s"></param>
    /// <returns></returns>
    public SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize
    EmImageFileSizeGet(string s)
    {
    SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize[]
    emA
    =
    SlowX.WebManage.Enums.ImageFileSize.EmArray;

    string theCode = null;

    foreach (SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize
    em in emA)
    {
    if (em == SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.缺省)
    continue;

    theCode = SlowX.WebManage.Enums.ImageFileSize.TheCodeGetByEnum(em);

    if (s.Contains("/" + theCode + "/"))
    return em;
    }

    return SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.缺省;
    }


    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripButton_粘帖板中写入_Click(object sender, EventArgs e)
    {
    try
    {
    tabControl1.SelectedTab = tabPage_图片;
    ClipboardToWrite();
    }
    catch (Exception err)
    {
    MsgForm.MsgException(err);
    }

    }

    /// <summary>
    ///
    /// </summary>
    protected void ClipboardToWrite()
    {
    //StringCollection sc = Clipboard.GetFileDropList();


    string str = Clipboard.GetText();

    if (str == null || str.Length == 0)
    {
    MsgShowForm.Error("没有复制内容。");
    return;
    }

    string[] sA = new string[1];
    sA[0] = str;


    AddImageFileToListView(sA);
    }


    /// <summary>
    ///
    /// </summary>
    /// <param name="sA"></param>
    protected void AddImageFileToListView(string[] sA)
    {
    List<SinaWeiBoImageDownInfo> theList
    =
    SinaWeiBoImageDownInfoListBuild(sA);

    ListView lv = listView_Main;

    string[] subItems = null;
    ListViewItem lvItem = null;
    mainGridIndex mi = mainGridIndex.instance;
    int colCount = lv.Columns.Count;
    int rowNumber = lv.Items.Count;

    foreach (SinaWeiBoImageDownInfo info in theList)
    {

    ++rowNumber;
    subItems = new string[colCount];
    subItems[mi._RowNumber] = rowNumber.ToString();
    subItems[mi.FileUrl] = info.FileUrl;
    subItems[mi.EmImageFileSizeV] = info.EmImageFileSizeV.ToString();

    lvItem = new ListViewItem(subItems);
    lv.Items.Add(lvItem);

    lvItem.Tag = info;
    }
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripButton_下载_Click(object sender, EventArgs e)
    {
    try
    {
    DownLoadImageList();
    }
    catch (Exception err)
    {
    MsgForm.MsgException(err);
    }
    }

    /// <summary>
    ///
    /// </summary>
    protected void DownLoadImageList()
    {
    System.Collections.Specialized.StringCollection sc
    = new System.Collections.Specialized.StringCollection();


    richTextBox_Output.Text = "";

    string theGuid = System.Guid.NewGuid().ToString("N");

    string rootDir = Application.StartupPath + "\\Outputs\\SinaWeiboImages\\" + DateTime.Now.ToString("yyyyMM") + "\\"
    + theGuid.Substring(0, 16) + "\\" + theGuid.Substring(16)+"\\";

    SinaWeiBoImageDownInfo info = null;
    string fileName = null;
    string saveName = null;
    int iCount = 0;

    foreach (ListViewItem item in listView_Main.Items)
    {
    info = item.Tag as SinaWeiBoImageDownInfo;

    if (!(info.EmImageFileSizeV == SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.缺省
    ||
    info.EmImageFileSizeV == SlowX.WebManage.Enums.ImageFileSize.EmImageFileSize.大图))
    continue;

    fileName = ToFileName(info.FileUrl);


    saveName = rootDir + fileName;

    if (DownLoadImage(saveName, info.FileUrl))
    {
    ++iCount;
    }

    richTextBox_Output.AppendText(saveName + System.Environment.NewLine);

    sc.Add(saveName);
    }


    Clipboard.SetFileDropList(sc);


    MsgShowForm.Succ("成功下载" + iCount.ToString() + "张图片");

    }

    /// <summary>
    /// 通过完整路径(包括网页路径),获得文件名
    /// </summary>
    /// <param name="str"></param>
    /// <returns></returns>
    public string ToFileName(string str)
    {
    int idxOne = str.LastIndexOf("/");
    int idxTwo = str.LastIndexOf("\\");

    if (idxOne == -1 && idxTwo == -1)
    {
    return str;
    }

    if (idxTwo > idxOne)
    return str.Substring(idxTwo + 1);
    else
    return str.Substring(idxOne + 1);

    }

    /// <summary>
    /// 远程下载图片
    /// </summary>
    /// <param name="saveName"></param>
    /// <param name="imageUrl"></param>
    /// <returns></returns>
    protected bool DownLoadImage
    (
    string saveName,
    string imageUrl
    )
    {

    FileInfo theInfo = new FileInfo(saveName);

    if (theInfo.Exists)
    return false;

    if (!theInfo.Directory.Exists)
    theInfo.Directory.Create();

    WebClient my = null;
    MemoryStream ms = null;
    System.Drawing.Image img = null;
    try
    {
    // 利用 WebClient 类
    my = new WebClient();

    byte[] mybyte = null;

    mybyte = my.DownloadData(imageUrl);

    ms = new MemoryStream(mybyte);

    img = System.Drawing.Image.FromStream(ms);

    // 保存 //
    img.Save(theInfo.FullName);

    return true;
    }
    catch
    {
    return false;
    }

    finally
    {
    if (img != null)
    {

    img.Dispose();
    img = null;
    }
    if (ms != null)
    {
    ms.Dispose();
    ms = null;
    }

    if (my != null)
    {

    my.Dispose();
    my = null;
    }

    }

    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripButton_清空目录_Click(object sender, EventArgs e)
    {
    try
    {
    string rootDir = Application.StartupPath + "\\Outputs\\SinaWeiboImages";

    Directory.Delete(rootDir, true);

    MsgShowForm.Succ("操作成功");
    }
    catch (Exception err)
    {
    MsgForm.MsgException(err);
    }
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripButton_复制_Click(object sender, EventArgs e)
    {
    try
    {

    System.Collections.Specialized.StringCollection sc
    =
    new System.Collections.Specialized.StringCollection();


    string[] sA = richTextBox_Output.Text.Split('\n');


    foreach (string s in sA)
    {

    if (s == null || s.Length == 0||s.Trim().Length==0)
    continue;

    sc.Add(s.Trim());
    }


    Clipboard.SetFileDropList(sc);
    }
    catch (Exception err)
    {
    MsgForm.MsgException(err);
    }

    MsgShowForm.Succ("复制成功");
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void toolStripButton_清空列表_Click(object sender, EventArgs e)
    {
    try
    {
    listView_Main.Items.Clear();

    MsgShowForm.Succ("操作成功");
    }
    catch (Exception err)
    {
    MsgForm.MsgException(err);
    }
    }



    }
    }




  • // .Designer.cs
    namespace SlowX.WebManage.UserControls.Admin.Apps.DownSinaWeiBoImage
    {
    partial class MainList
    {
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
    protected override void Dispose(bool disposing)
    {
    if (disposing && (components != null))
    {
    components.Dispose();
    }
    base.Dispose(disposing);
    }

    #region 组件设计器生成的代码

    /// <summary>
    /// 设计器支持所需的方法 - 不要
    /// 使用代码编辑器修改此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.toolStrip_Main = new System.Windows.Forms.ToolStrip();
    this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
    this.toolStripSeparator_HomePage = new System.Windows.Forms.ToolStripSeparator();
    this.tabControl1 = new System.Windows.Forms.TabControl();
    this.tabPage_图片 = new System.Windows.Forms.TabPage();
    this.listView_Main = new System.Windows.Forms.ListView();
    this.columnHeader__RowNumber = new System.Windows.Forms.ColumnHeader();
    this.ColumnHeader_FileName = new System.Windows.Forms.ColumnHeader();
    this.columnHeader_EmImageFileSizeV = new System.Windows.Forms.ColumnHeader();
    this.tabPage_输出 = new System.Windows.Forms.TabPage();
    this.richTextBox_Output = new System.Windows.Forms.RichTextBox();
    this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
    this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
    this.toolStripDropDownButton_Title = new System.Windows.Forms.ToolStripDropDownButton();
    this.刷新ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    this.关闭ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    this.关闭所有ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    this.除此之外全部关闭ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
    this.toolStripMenuItem_打开程序所在目录 = new System.Windows.Forms.ToolStripMenuItem();
    this.toolStripButton_HomePage = new System.Windows.Forms.ToolStripButton();
    this.toolStripButton_粘帖板中写入 = new System.Windows.Forms.ToolStripButton();
    this.toolStripButton_下载 = new System.Windows.Forms.ToolStripButton();
    this.toolStripButton_清空目录 = new System.Windows.Forms.ToolStripButton();
    this.toolStripButton_复制 = new System.Windows.Forms.ToolStripButton();
    this.toolStripButton_清空列表 = new System.Windows.Forms.ToolStripButton();
    this.toolStrip_Main.SuspendLayout();
    this.tabControl1.SuspendLayout();
    this.tabPage_图片.SuspendLayout();
    this.tabPage_输出.SuspendLayout();
    this.SuspendLayout();
    //
    // toolStrip_Main
    //
    this.toolStrip_Main.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    this.toolStripDropDownButton_Title,
    this.toolStripSeparator1,
    this.toolStripButton_HomePage,
    this.toolStripSeparator_HomePage,
    this.toolStripButton_粘帖板中写入,
    this.toolStripSeparator3,
    this.toolStripButton_下载,
    this.toolStripSeparator4,
    this.toolStripButton_清空目录,
    this.toolStripButton_复制,
    this.toolStripButton_清空列表});
    this.toolStrip_Main.Location = new System.Drawing.Point(0, 0);
    this.toolStrip_Main.Name = "toolStrip_Main";
    this.toolStrip_Main.Size = new System.Drawing.Size(861, 25);
    this.toolStrip_Main.TabIndex = 9;
    this.toolStrip_Main.Text = "toolStrip1";
    //
    // toolStripSeparator1
    //
    this.toolStripSeparator1.Name = "toolStripSeparator1";
    this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
    //
    // toolStripSeparator_HomePage
    //
    this.toolStripSeparator_HomePage.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
    this.toolStripSeparator_HomePage.Name = "toolStripSeparator_HomePage";
    this.toolStripSeparator_HomePage.Size = new System.Drawing.Size(6, 25);
    //
    // tabControl1
    //
    this.tabControl1.Controls.Add(this.tabPage_图片);
    this.tabControl1.Controls.Add(this.tabPage_输出);
    this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
    this.tabControl1.Location = new System.Drawing.Point(0, 25);
    this.tabControl1.Name = "tabControl1";
    this.tabControl1.SelectedIndex = 0;
    this.tabControl1.Size = new System.Drawing.Size(861, 495);
    this.tabControl1.TabIndex = 10;
    //
    // tabPage_图片
    //
    this.tabPage_图片.Controls.Add(this.listView_Main);
    this.tabPage_图片.Location = new System.Drawing.Point(4, 22);
    this.tabPage_图片.Name = "tabPage_图片";
    this.tabPage_图片.Padding = new System.Windows.Forms.Padding(3);
    this.tabPage_图片.Size = new System.Drawing.Size(853, 469);
    this.tabPage_图片.TabIndex = 1;
    this.tabPage_图片.Text = "图片";
    this.tabPage_图片.UseVisualStyleBackColor = true;
    //
    // listView_Main
    //
    this.listView_Main.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
    this.columnHeader__RowNumber,
    this.ColumnHeader_FileName,
    this.columnHeader_EmImageFileSizeV});
    this.listView_Main.Dock = System.Windows.Forms.DockStyle.Fill;
    this.listView_Main.FullRowSelect = true;
    this.listView_Main.GridLines = true;
    this.listView_Main.Location = new System.Drawing.Point(3, 3);
    this.listView_Main.Name = "listView_Main";
    this.listView_Main.Size = new System.Drawing.Size(847, 463);
    this.listView_Main.TabIndex = 151;
    this.listView_Main.UseCompatibleStateImageBehavior = false;
    this.listView_Main.View = System.Windows.Forms.View.Details;
    //
    // columnHeader__RowNumber
    //
    this.columnHeader__RowNumber.Text = "序号";
    this.columnHeader__RowNumber.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
    //
    // ColumnHeader_FileName
    //
    this.ColumnHeader_FileName.Text = "图片地址";
    this.ColumnHeader_FileName.Width = 555;
    //
    // columnHeader_EmImageFileSizeV
    //
    this.columnHeader_EmImageFileSizeV.Text = "类型";
    //
    // tabPage_输出
    //
    this.tabPage_输出.Controls.Add(this.richTextBox_Output);
    this.tabPage_输出.Location = new System.Drawing.Point(4, 22);
    this.tabPage_输出.Name = "tabPage_输出";
    this.tabPage_输出.Padding = new System.Windows.Forms.Padding(3);
    this.tabPage_输出.Size = new System.Drawing.Size(853, 469);
    this.tabPage_输出.TabIndex = 0;
    this.tabPage_输出.Text = "输出";
    this.tabPage_输出.UseVisualStyleBackColor = true;
    //
    // richTextBox_Output
    //
    this.richTextBox_Output.Dock = System.Windows.Forms.DockStyle.Fill;
    this.richTextBox_Output.Location = new System.Drawing.Point(3, 3);
    this.richTextBox_Output.Name = "richTextBox_Output";
    this.richTextBox_Output.Size = new System.Drawing.Size(847, 463);
    this.richTextBox_Output.TabIndex = 0;
    this.richTextBox_Output.Text = "";
    //
    // toolStripSeparator3
    //
    this.toolStripSeparator3.Name = "toolStripSeparator3";
    this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
    //
    // toolStripSeparator4
    //
    this.toolStripSeparator4.Name = "toolStripSeparator4";
    this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
    //
    // toolStripDropDownButton_Title
    //
    this.toolStripDropDownButton_Title.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
    this.刷新ToolStripMenuItem,
    this.关闭ToolStripMenuItem,
    this.关闭所有ToolStripMenuItem,
    this.除此之外全部关闭ToolStripMenuItem,
    this.toolStripSeparator2,
    this.toolStripMenuItem_打开程序所在目录});
    this.toolStripDropDownButton_Title.Image = global::SlowX.WebManage.Properties.Resources.application_form;
    this.toolStripDropDownButton_Title.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripDropDownButton_Title.Name = "toolStripDropDownButton_Title";
    this.toolStripDropDownButton_Title.Size = new System.Drawing.Size(61, 22);
    this.toolStripDropDownButton_Title.Text = "菜单";
    //
    // 刷新ToolStripMenuItem
    //
    this.刷新ToolStripMenuItem.Image = global::SlowX.WebManage.Properties.Resources.table_refresh;
    this.刷新ToolStripMenuItem.Name = "刷新ToolStripMenuItem";
    this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
    this.刷新ToolStripMenuItem.Text = "刷新";
    this.刷新ToolStripMenuItem.Click += new System.EventHandler(this.刷新ToolStripMenuItem_Click);
    //
    // 关闭ToolStripMenuItem
    //
    this.关闭ToolStripMenuItem.Image = global::SlowX.WebManage.Properties.Resources.application_form_delete;
    this.关闭ToolStripMenuItem.Name = "关闭ToolStripMenuItem";
    this.关闭ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
    this.关闭ToolStripMenuItem.Text = "关闭";
    this.关闭ToolStripMenuItem.Click += new System.EventHandler(this.关闭ToolStripMenuItem_Click);
    //
    // 关闭所有ToolStripMenuItem
    //
    this.关闭所有ToolStripMenuItem.Image = global::SlowX.WebManage.Properties.Resources.world_delete;
    this.关闭所有ToolStripMenuItem.Name = "关闭所有ToolStripMenuItem";
    this.关闭所有ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
    this.关闭所有ToolStripMenuItem.Text = "关闭所有";
    this.关闭所有ToolStripMenuItem.Click += new System.EventHandler(this.关闭所有ToolStripMenuItem_Click);
    //
    // 除此之外全部关闭ToolStripMenuItem
    //
    this.除此之外全部关闭ToolStripMenuItem.Image = global::SlowX.WebManage.Properties.Resources.application_form_add;
    this.除此之外全部关闭ToolStripMenuItem.Name = "除此之外全部关闭ToolStripMenuItem";
    this.除此之外全部关闭ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
    this.除此之外全部关闭ToolStripMenuItem.Text = "除此之外全部关闭";
    this.除此之外全部关闭ToolStripMenuItem.Click += new System.EventHandler(this.除此之外全部关闭ToolStripMenuItem_Click);
    //
    // toolStripSeparator2
    //
    this.toolStripSeparator2.Name = "toolStripSeparator2";
    this.toolStripSeparator2.Size = new System.Drawing.Size(169, 6);
    //
    // toolStripMenuItem_打开程序所在目录
    //
    this.toolStripMenuItem_打开程序所在目录.Image = global::SlowX.WebManage.Properties.Resources.folder_go;
    this.toolStripMenuItem_打开程序所在目录.Name = "toolStripMenuItem_打开程序所在目录";
    this.toolStripMenuItem_打开程序所在目录.Size = new System.Drawing.Size(172, 22);
    this.toolStripMenuItem_打开程序所在目录.Text = "打开程序所在目录";
    this.toolStripMenuItem_打开程序所在目录.Click += new System.EventHandler(this.toolStripMenuItem_打开程序所在目录_Click);
    //
    // toolStripButton_HomePage
    //
    this.toolStripButton_HomePage.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
    this.toolStripButton_HomePage.Image = global::SlowX.WebManage.Properties.Resources.application_home;
    this.toolStripButton_HomePage.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripButton_HomePage.Name = "toolStripButton_HomePage";
    this.toolStripButton_HomePage.Size = new System.Drawing.Size(187, 22);
    this.toolStripButton_HomePage.Text = "霜叶工作室(www.slowx.net)";
    this.toolStripButton_HomePage.Click += new System.EventHandler(this.toolStripButton_HomePage_Click);
    //
    // toolStripButton_粘帖板中写入
    //
    this.toolStripButton_粘帖板中写入.Image = global::SlowX.WebManage.Properties.Resources.page_save;
    this.toolStripButton_粘帖板中写入.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripButton_粘帖板中写入.Name = "toolStripButton_粘帖板中写入";
    this.toolStripButton_粘帖板中写入.Size = new System.Drawing.Size(100, 22);
    this.toolStripButton_粘帖板中写入.Text = "粘帖板中写入";
    this.toolStripButton_粘帖板中写入.Click += new System.EventHandler(this.toolStripButton_粘帖板中写入_Click);
    //
    // toolStripButton_下载
    //
    this.toolStripButton_下载.Image = global::SlowX.WebManage.Properties.Resources.disk_download;
    this.toolStripButton_下载.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripButton_下载.Name = "toolStripButton_下载";
    this.toolStripButton_下载.Size = new System.Drawing.Size(52, 22);
    this.toolStripButton_下载.Text = "下载";
    this.toolStripButton_下载.Click += new System.EventHandler(this.toolStripButton_下载_Click);
    //
    // toolStripButton_清空目录
    //
    this.toolStripButton_清空目录.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
    this.toolStripButton_清空目录.Image = global::SlowX.WebManage.Properties.Resources.folder_delete;
    this.toolStripButton_清空目录.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripButton_清空目录.Name = "toolStripButton_清空目录";
    this.toolStripButton_清空目录.Size = new System.Drawing.Size(76, 22);
    this.toolStripButton_清空目录.Text = "清空目录";
    this.toolStripButton_清空目录.Click += new System.EventHandler(this.toolStripButton_清空目录_Click);
    //
    // toolStripButton_复制
    //
    this.toolStripButton_复制.Image = global::SlowX.WebManage.Properties.Resources.page_copy;
    this.toolStripButton_复制.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripButton_复制.Name = "toolStripButton_复制";
    this.toolStripButton_复制.Size = new System.Drawing.Size(52, 22);
    this.toolStripButton_复制.Text = "复制";
    this.toolStripButton_复制.Click += new System.EventHandler(this.toolStripButton_复制_Click);
    //
    // toolStripButton_清空列表
    //
    this.toolStripButton_清空列表.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
    this.toolStripButton_清空列表.Image = global::SlowX.WebManage.Properties.Resources.delete;
    this.toolStripButton_清空列表.ImageTransparentColor = System.Drawing.Color.Magenta;
    this.toolStripButton_清空列表.Name = "toolStripButton_清空列表";
    this.toolStripButton_清空列表.Size = new System.Drawing.Size(76, 22);
    this.toolStripButton_清空列表.Text = "清空列表";
    this.toolStripButton_清空列表.Click += new System.EventHandler(this.toolStripButton_清空列表_Click);
    //
    // MainList
    //
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.Controls.Add(this.tabControl1);
    this.Controls.Add(this.toolStrip_Main);
    this.Name = "MainList";
    this.Size = new System.Drawing.Size(861, 520);
    this.Load += new System.EventHandler(this.MainList_Load);
    this.toolStrip_Main.ResumeLayout(false);
    this.toolStrip_Main.PerformLayout();
    this.tabControl1.ResumeLayout(false);
    this.tabPage_图片.ResumeLayout(false);
    this.tabPage_输出.ResumeLayout(false);
    this.ResumeLayout(false);
    this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.ToolStrip toolStrip_Main;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
    private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton_Title;
    private System.Windows.Forms.ToolStripMenuItem 刷新ToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem 关闭ToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem 关闭所有ToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem 除此之外全部关闭ToolStripMenuItem;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
    private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_打开程序所在目录;
    private System.Windows.Forms.ToolStripButton toolStripButton_HomePage;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator_HomePage;
    private System.Windows.Forms.TabControl tabControl1;
    private System.Windows.Forms.TabPage tabPage_图片;
    private System.Windows.Forms.ListView listView_Main;
    private System.Windows.Forms.ColumnHeader columnHeader__RowNumber;
    private System.Windows.Forms.ColumnHeader ColumnHeader_FileName;
    private System.Windows.Forms.TabPage tabPage_输出;
    private System.Windows.Forms.RichTextBox richTextBox_Output;
    private System.Windows.Forms.ToolStripButton toolStripButton_粘帖板中写入;
    private System.Windows.Forms.ColumnHeader columnHeader_EmImageFileSizeV;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
    private System.Windows.Forms.ToolStripButton toolStripButton_下载;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
    private System.Windows.Forms.ToolStripButton toolStripButton_清空目录;
    private System.Windows.Forms.ToolStripButton toolStripButton_复制;
    private System.Windows.Forms.ToolStripButton toolStripButton_清空列表;
    }
    }

标签:下载sina微博的图片的代码 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)