下载中心┊文章中心┊软件分类┊更新软件┊推荐下载┊热门软件┊更新文章┊热门文章
 
《拓文asp.net网站内容管理系统》官方演示站。
 设为首页    
 收藏本站
 作者:黄振安
 
网站首页 开源拓文 .NET编程 网站编程 网页设计 图形图像 数据库 软件工程留言本
    站内搜索:   
您现在的位置: 拓文网络 → 文章中心 → .NET编程 → ASP.NET → 用 WebClient.UploadData 方法 上载文件数据[正文]

热 门 文 章

相 关 文 章
没有相关文章!
用 WebClient.UploadData 方法 上载文件数据
 
[作者:宝玉    转贴自:http://blog.joycode.com/dotey    点击数:    字体:【大 中 小】    更新时间:2006-2-24 20:53:49]


  在Winform中调用
  
  
  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;
  
  using UploadData.Common;
  using System.IO;
  
  namespace UploadDataWin
  ...{
   /**////
   /// frmUpload 的摘要说明。
   ///

   public class frmUpload : System.Windows.Forms.Form
   ...{
   private System.Windows.Forms.Label lblAmigoToken;
   private System.Windows.Forms.TextBox txtAmigoToken;
   private System.Windows.Forms.Label lblFilename;
   private System.Windows.Forms.TextBox txtFilename;
   private System.Windows.Forms.Button btnBrowse;
   private System.Windows.Forms.TextBox txtFileData;
   private System.Windows.Forms.Label lblFileData;
   private System.Windows.Forms.Button btnUpload;
   private System.Windows.Forms.OpenFileDialog openFileDialog1;
   private System.Windows.Forms.TextBox txtResponse;
   /**////
   /// 必需的设计器变量。
   ///

   private System.ComponentModel.Container components = null;
  
   public frmUpload()
   ...{
   //
   // Windows 窗体设计器支持所必需的
   //
   InitializeComponent();
  
   //
   // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
   //
   }
  
   /**////
   /// 清理所有正在使用的资源。
   ///

   protected override void Dispose( bool disposing )
   ...{
   if( disposing )
   ...{
   if (components != null)
   ...{
   components.Dispose();
   }
   }
   base.Dispose( disposing );
   }
  
   Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
   /**////
   /// 设计器支持所需的方法 - 不要使用代码编辑器修改
   /// 此方法的内容。
   ///

   private void InitializeComponent()
   ...{
   this.lblAmigoToken = new System.Windows.Forms.Label();
   this.txtAmigoToken = new System.Windows.Forms.TextBox();
   this.lblFilename = new System.Windows.Forms.Label();
   this.txtFilename = new System.Windows.Forms.TextBox();
   this.btnBrowse = new System.Windows.Forms.Button();
   this.txtFileData = new System.Windows.Forms.TextBox();
   this.lblFileData = new System.Windows.Forms.Label();
   this.btnUpload = new System.Windows.Forms.Button();
   this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
   this.txtResponse = new System.Windows.Forms.TextBox();
   this.SuspendLayout();
   //
   // lblAmigoToken
   //
   this.lblAmigoToken.Location = new System.Drawing.Point(40, 48);
   this.lblAmigoToken.Name = "lblAmigoToken";
   this.lblAmigoToken.Size = new System.Drawing.Size(72, 23);
   this.lblAmigoToken.TabIndex = 0;
   this.lblAmigoToken.Text = "AmigoToken";
   //
   // txtAmigoToken
   //
   this.txtAmigoToken.Location = new System.Drawing.Point(120, 48);
   this.txtAmigoToken.Name = "txtAmigoToken";
   this.txtAmigoToken.Size = new System.Drawing.Size(248, 21);
   this.txtAmigoToken.TabIndex = 1;
   this.txtAmigoToken.Text = "";
   //
   // lblFilename
   //
   this.lblFilename.Location = new System.Drawing.Point(40, 96);
   this.lblFilename.Name = "lblFilename";
   this.lblFilename.Size = new System.Drawing.Size(80, 23);
   this.lblFilename.TabIndex = 2;
   this.lblFilename.Text = "Filename";
   //
   // txtFilename
   //
   this.txtFilename.Location = new System.Drawing.Point(120, 96);
   this.txtFilename.Name = "txtFilename";
   this.txtFilename.Size = new System.Drawing.Size(248, 21);
   this.txtFilename.TabIndex = 3;
   this.txtFilename.Text = "";
   //
   // btnBrowse
   //
   this.btnBrowse.Location = new System.Drawing.Point(296, 144);
   this.btnBrowse.Name = "btnBrowse";
   this.btnBrowse.TabIndex = 4;
   this.btnBrowse.Text = "浏览...";
   this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
   //
   // txtFileData
   //
   this.txtFileData.Location = new System.Drawing.Point(120, 144);
   this.txtFileData.Name = "txtFileData";
   this.txtFileData.Size = new System.Drawing.Size(168, 21);
   this.txtFileData.TabIndex = 5;
   this.txtFileData.Text = "";
   //
   // lblFileData
   //
   this.lblFileData.Location = new System.Drawing.Point(40, 144);
   this.lblFileData.Name = "lblFileData";
   this.lblFileData.Size = new System.Drawing.Size(72, 23);
   this.lblFileData.TabIndex = 6;
   this.lblFileData.Text = "FileData";
   //
   // btnUpload
   //
   this.btnUpload.Location = new System.Drawing.Point(48, 184);
   this.btnUpload.Name = "btnUpload";
   this.btnUpload.TabIndex = 7;
   this.btnUpload.Text = "Upload";
   this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click);
   //
   // txtResponse
   //
   this.txtResponse.Location = new System.Drawing.Point(136, 184);
   this.txtResponse.Multiline = true;
   this.txtResponse.Name = "txtResponse";
   this.txtResponse.Size = new System.Drawing.Size(248, 72);
   this.txtResponse.TabIndex = 8;
   this.txtResponse.Text = "";
   //
   // frmUpload
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(400, 269);
   this.Controls.Add(this.txtResponse);
   this.Controls.Add(this.btnUpload);
   this.Controls.Add(this.lblFileData);
   this.Controls.Add(this.txtFileData);
   this.Controls.Add(this.btnBrowse);
   this.Controls.Add(this.txtFilename);
   this.Controls.Add(this.lblFilename);
   this.Controls.Add(this.txtAmigoToken);
   this.Controls.Add(this.lblAmigoToken);
   this.Name = "frmUpload";
   this.Text = "frmUpload";
   this.ResumeLayout(false);
  
   }
   #endregion 
   
页次:4/5  1篇/页  首页   上一页   下一页   尾页  合计 5 篇 Go:
 
上一篇:没有文章
下一篇:ASP.NET Cache
winner 打印本页 关闭窗口

     文 章 评 论
评论人 查看该文章的评论 发表时间
   笔 名* : 0 50分 60分 70分 80分 90分 100分
评论内容 *: (最多600字。当前字数:0)


没有相关评论,欢迎您参与!

- 关于本站 - 网站帮助 - 下载声明 - 友情连接 - 网站地图 -
Copyright © 2005-2006 rtht.Com. All Rights Reserved . [桂ICP备06004496号]程序设计: 拓文ASP.NET网站内容管理系统 V2.6 SQL版