⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.cs

📁 用于文件传输的Web服务客户端
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Configuration;
using System.Data;
using System.IO;
using System.Data.OleDb;

namespace E3.Client.SZSEClient
{
	/// <summary>
	/// Summary description for FrmMain.
	/// </summary>
	public class FrmMain : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button CmdClose;
		private System.Windows.Forms.Button CmdStart;
		private System.Windows.Forms.Button CmdAutoRun;
		private System.Windows.Forms.Label lblHelp;
		private System.Windows.Forms.TextBox txtStatus;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.NotifyIcon NoI;
		private System.Windows.Forms.ProgressBar progressBar1;
		private System.Windows.Forms.Button CmdTest;
		private System.Windows.Forms.DataGrid dataGrid1;
		private System.Windows.Forms.TextBox txtCurrTrans;
		private System.Windows.Forms.TextBox txtAllText;
		private System.ComponentModel.IContainer components;

		public FrmMain()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}
		public FrmMain(int autoRun)
		{
			//
			// Required for Windows Form Designer support
			//			
			InitializeComponent();
			if(autoRun==1)
			{
				try
				{				
					System.Threading.ThreadStart threadStart =new System.Threading.ThreadStart(TransThread);
					System.Threading.Thread thread =new System.Threading.Thread(threadStart);
					thread.IsBackground =true;
					thread.Start();
					this.WindowState=System.Windows.Forms.FormWindowState.Minimized;
					CmdAutoRun.Enabled=false;
					this.Visible=false;
				}
				catch
				{}
			}
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmMain));
			this.CmdClose = new System.Windows.Forms.Button();
			this.CmdStart = new System.Windows.Forms.Button();
			this.CmdAutoRun = new System.Windows.Forms.Button();
			this.NoI = new System.Windows.Forms.NotifyIcon(this.components);
			this.lblHelp = new System.Windows.Forms.Label();
			this.txtStatus = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.progressBar1 = new System.Windows.Forms.ProgressBar();
			this.CmdTest = new System.Windows.Forms.Button();
			this.dataGrid1 = new System.Windows.Forms.DataGrid();
			this.txtCurrTrans = new System.Windows.Forms.TextBox();
			this.txtAllText = new System.Windows.Forms.TextBox();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
			this.SuspendLayout();
			// 
			// CmdClose
			// 
			this.CmdClose.Location = new System.Drawing.Point(392, 120);
			this.CmdClose.Name = "CmdClose";
			this.CmdClose.Size = new System.Drawing.Size(80, 24);
			this.CmdClose.TabIndex = 5;
			this.CmdClose.Text = "Close";
			this.CmdClose.Click += new System.EventHandler(this.CmdClose_Click);
			// 
			// CmdStart
			// 
			this.CmdStart.Location = new System.Drawing.Point(296, 120);
			this.CmdStart.Name = "CmdStart";
			this.CmdStart.Size = new System.Drawing.Size(80, 24);
			this.CmdStart.TabIndex = 4;
			this.CmdStart.Text = "Start";
			this.CmdStart.Click += new System.EventHandler(this.CmdStart_Click);
			// 
			// CmdAutoRun
			// 
			this.CmdAutoRun.Location = new System.Drawing.Point(208, 120);
			this.CmdAutoRun.Name = "CmdAutoRun";
			this.CmdAutoRun.Size = new System.Drawing.Size(80, 24);
			this.CmdAutoRun.TabIndex = 7;
			this.CmdAutoRun.Text = "AutoRun";
			this.CmdAutoRun.Click += new System.EventHandler(this.CmdAutoRun_Click);
			// 
			// NoI
			// 
			this.NoI.Icon = ((System.Drawing.Icon)(resources.GetObject("NoI.Icon")));
			this.NoI.Text = "E3 is runing......";
			this.NoI.Visible = true;
			this.NoI.Click += new System.EventHandler(this.NoI_Click);
			// 
			// lblHelp
			// 
			this.lblHelp.Location = new System.Drawing.Point(16, 32);
			this.lblHelp.Name = "lblHelp";
			this.lblHelp.Size = new System.Drawing.Size(456, 72);
			this.lblHelp.TabIndex = 8;
			this.lblHelp.Text = "运行说明:";
			// 
			// txtStatus
			// 
			this.txtStatus.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.txtStatus.Location = new System.Drawing.Point(16, 173);
			this.txtStatus.Multiline = true;
			this.txtStatus.Name = "txtStatus";
			this.txtStatus.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.txtStatus.Size = new System.Drawing.Size(456, 160);
			this.txtStatus.TabIndex = 9;
			this.txtStatus.Text = "";
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.Location = new System.Drawing.Point(24, 127);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(88, 16);
			this.label1.TabIndex = 10;
			this.label1.Text = "状态:";
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label2.Location = new System.Drawing.Point(16, 8);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(80, 16);
			this.label2.TabIndex = 11;
			this.label2.Text = "运行说明:";
			// 
			// progressBar1
			// 
			this.progressBar1.Location = new System.Drawing.Point(16, 160);
			this.progressBar1.Name = "progressBar1";
			this.progressBar1.Size = new System.Drawing.Size(456, 16);
			this.progressBar1.TabIndex = 12;
			this.progressBar1.Visible = false;
			// 
			// CmdTest
			// 
			this.CmdTest.Location = new System.Drawing.Point(144, 120);
			this.CmdTest.Name = "CmdTest";
			this.CmdTest.Size = new System.Drawing.Size(56, 24);
			this.CmdTest.TabIndex = 13;
			this.CmdTest.Text = "Test";
			this.CmdTest.Click += new System.EventHandler(this.CmdTest_Click);
			// 
			// dataGrid1
			// 
			this.dataGrid1.DataMember = "";
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(64, 344);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.Size = new System.Drawing.Size(376, 144);
			this.dataGrid1.TabIndex = 14;
			// 
			// txtCurrTrans
			// 
			this.txtCurrTrans.Location = new System.Drawing.Point(8, 344);
			this.txtCurrTrans.Name = "txtCurrTrans";
			this.txtCurrTrans.Size = new System.Drawing.Size(48, 21);
			this.txtCurrTrans.TabIndex = 15;
			this.txtCurrTrans.Text = "textBox1";
			this.txtCurrTrans.Visible = false;
			// 
			// txtAllText
			// 
			this.txtAllText.Location = new System.Drawing.Point(8, 368);
			this.txtAllText.Multiline = true;
			this.txtAllText.Name = "txtAllText";
			this.txtAllText.Size = new System.Drawing.Size(48, 24);
			this.txtAllText.TabIndex = 16;
			this.txtAllText.Text = "textBox1";
			this.txtAllText.Visible = false;
			// 
			// FrmMain
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.LightGray;
			this.ClientSize = new System.Drawing.Size(504, 510);
			this.Controls.Add(this.txtAllText);
			this.Controls.Add(this.txtCurrTrans);
			this.Controls.Add(this.txtStatus);
			this.Controls.Add(this.dataGrid1);
			this.Controls.Add(this.CmdTest);
			this.Controls.Add(this.progressBar1);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.lblHelp);
			this.Controls.Add(this.CmdAutoRun);
			this.Controls.Add(this.CmdClose);
			this.Controls.Add(this.CmdStart);
			this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.HelpButton = true;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.Name = "FrmMain";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "E3 Client";
			this.SizeChanged += new System.EventHandler(this.FrmMain_SizeChanged);
			this.Load += new System.EventHandler(this.FrmMain_Load);
			this.Closed += new System.EventHandler(this.FrmMain_Closed);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion
		private void FrmMain_Load(object sender, System.EventArgs e)
		{
			try
			{
				string strHelp="";
				//strHelp+="运行说明:\r\n";				
				strHelp+="1.AutoRun---表示后台自动运行传输程序;\r\n";
				strHelp+="2.Start---单步执行传输程序;\r\n";
				strHelp+="3.Run by Param---SZSEClient [filename]通过参数传递一个文件。\r\n";
				lblHelp.Text=strHelp;
			}
			catch
			{}
		}
		private void initform()
		{
			//				DataTable Dt=new DataTable();
			//				
			//				DataColumn Dc=new DataColumn();
			//				Dc.ColumnName="ParamName";			

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -