[C#]使用WebClient上傳檔案並同時Post表單資料欄位到服務端
阿新 • • 發佈:2019-02-07
{
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);
}
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
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.SuspendLayout();
//
// lblAmigoToken
//
this.lblAmigoToken.Location =new System.Drawing.Point(40, 48);
this.lblAmigoToken.Name ="lblAmigoToken";
this.lblAmigoToken.Size
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);
}