爱易网页
ASP.NET教程
用Visual C#实现文件下载
日期:2010-07-07 浏览次数:20406 次
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.IO; using System.Threading; namespace MyGetCar { /// /// Form1 的摘要说明。 /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox srcAddress; private System.Windows.Forms.TextBox tarAddress; private System.Windows.Forms.StatusBar statusBar; private System.Windows.Forms.Button Start; private WebClient client = new WebClient(); /// /// 必需的设计器变量。 /// private System.ComponentModel.Container components = null; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } /// /// 清理所有正在使用的资源。 /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.srcAddress = new System.Windows.Forms.TextBox(); this.tarAddress = new System.Windows.Forms.TextBox(); this.statusBar = new System.Windows.Forms.StatusBar(); this.Start = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(8, 32); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(72, 23); this.label1.TabIndex = 0; this.label1.Text = "文件地址:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label2 // this.label2.Location = new System.Drawing.Point(8, 72); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(72, 23); this.label2.TabIndex = 1; this.label2.Text = "另存到:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // srcAddress // this.srcAddress.Location = new System.Drawing.Point(80, 32); this.srcAddress.Name =
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。