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

📄 logdlg.cs

📁 一个WINCE下用ado.net连接数据库的例子 作者:tanis
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace AutoRefresh
{
	/// <summary>
	/// LogDlg 的摘要说明。
	/// </summary>
	public class LogDlg : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.TextBox tbLogName;
		private System.Windows.Forms.TextBox tbLogPsw;
		private System.Windows.Forms.TextBox tbServerName;
		private System.Windows.Forms.TextBox tbFileName;
		private System.Windows.Forms.Button btnSave;
		private System.Windows.Forms.Button btnClose;
		private System.Windows.Forms.Label label6;
	
		public LogDlg()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LogDlg));
			this.panel2 = new System.Windows.Forms.Panel();
			this.label3 = new System.Windows.Forms.Label();
			this.tbLogName = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.tbLogPsw = new System.Windows.Forms.TextBox();
			this.label6 = new System.Windows.Forms.Label();
			this.tbServerName = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.tbFileName = new System.Windows.Forms.TextBox();
			this.label7 = new System.Windows.Forms.Label();
			this.btnSave = new System.Windows.Forms.Button();
			this.btnClose = new System.Windows.Forms.Button();
			// 
			// panel2
			// 
			this.panel2.BackColor = System.Drawing.SystemColors.ControlLight;
			this.panel2.Controls.Add(this.label3);
			this.panel2.Controls.Add(this.tbLogName);
			this.panel2.Controls.Add(this.label4);
			this.panel2.Controls.Add(this.tbLogPsw);
			this.panel2.Location = new System.Drawing.Point(8, 80);
			this.panel2.Size = new System.Drawing.Size(224, 72);
			// 
			// label3
			// 
			this.label3.ForeColor = System.Drawing.Color.Red;
			this.label3.Location = new System.Drawing.Point(8, 48);
			this.label3.Size = new System.Drawing.Size(104, 20);
			this.label3.Text = "数据库登陆密码:";
			// 
			// tbLogName
			// 
			this.tbLogName.ForeColor = System.Drawing.Color.Blue;
			this.tbLogName.Location = new System.Drawing.Point(136, 16);
			this.tbLogName.Size = new System.Drawing.Size(88, 21);
			this.tbLogName.Text = "";
			// 
			// label4
			// 
			this.label4.ForeColor = System.Drawing.Color.Red;
			this.label4.Location = new System.Drawing.Point(8, 16);
			this.label4.Size = new System.Drawing.Size(96, 20);
			this.label4.Text = "数据库登陆名:";
			// 
			// tbLogPsw
			// 
			this.tbLogPsw.ForeColor = System.Drawing.Color.Blue;
			this.tbLogPsw.Location = new System.Drawing.Point(136, 40);
			this.tbLogPsw.Size = new System.Drawing.Size(88, 21);
			this.tbLogPsw.Text = "";
			// 
			// label6
			// 
			this.label6.ForeColor = System.Drawing.SystemColors.WindowText;
			this.label6.Location = new System.Drawing.Point(8, 16);
			this.label6.Size = new System.Drawing.Size(168, 16);
			this.label6.Text = "用户客户端连接配置:";
			// 
			// tbServerName
			// 
			this.tbServerName.ForeColor = System.Drawing.Color.Blue;
			this.tbServerName.Location = new System.Drawing.Point(144, 48);
			this.tbServerName.Size = new System.Drawing.Size(88, 21);
			this.tbServerName.Text = "";
			// 
			// label5
			// 
			this.label5.ForeColor = System.Drawing.Color.Red;
			this.label5.Location = new System.Drawing.Point(16, 48);
			this.label5.Size = new System.Drawing.Size(120, 20);
			this.label5.Text = "数据库服务器地址:";
			// 
			// tbFileName
			// 
			this.tbFileName.ForeColor = System.Drawing.Color.Blue;
			this.tbFileName.Location = new System.Drawing.Point(144, 168);
			this.tbFileName.Size = new System.Drawing.Size(88, 21);
			this.tbFileName.Text = "";
			// 
			// label7
			// 
			this.label7.ForeColor = System.Drawing.Color.Red;
			this.label7.Location = new System.Drawing.Point(8, 168);
			this.label7.Size = new System.Drawing.Size(120, 20);
			this.label7.Text = "下载文件保存路径:";
			// 
			// btnSave
			// 
			this.btnSave.Location = new System.Drawing.Point(16, 208);
			this.btnSave.Size = new System.Drawing.Size(72, 32);
			this.btnSave.Text = "保存";
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// btnClose
			// 
			this.btnClose.Location = new System.Drawing.Point(136, 208);
			this.btnClose.Size = new System.Drawing.Size(72, 32);
			this.btnClose.Text = "关闭";
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// LogDlg
			// 
			this.ClientSize = new System.Drawing.Size(250, 271);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.tbFileName);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.tbServerName);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.panel2);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Text = "LogDlg";
			this.Load += new System.EventHandler(this.LogDlg_Load);

		}
		#endregion

		private void LogDlg_Load(object sender, System.EventArgs e)
		{
			tbServerName.Text =Form1.static_Para.sServerName ;
			tbLogName.Text = Form1.static_Para.sUserName;
			tbLogPsw.Text = Form1.static_Para.sUserPsw;
			tbFileName.Text = Form1.static_Para.sFilePath;
		
		}

		private void label1_ParentChanged(object sender, System.EventArgs e)
		{
		
		}

		private void label2_ParentChanged(object sender, System.EventArgs e)
		{
		
		}

		private void btnClose_Click(object sender, System.EventArgs e)
		{
		  this.Hide();
		}

		private void btnSave_Click(object sender, System.EventArgs e)
		{
			Form1.static_Para.sServerName = tbServerName.Text.Trim();
	        Form1.static_Para.sUserName = tbLogName.Text.Trim();
	        Form1.static_Para.sUserPsw = tbLogPsw.Text.Trim();
	        Form1.static_Para.sFilePath = tbFileName.Text.Trim();
		}
	}
}

⌨️ 快捷键说明

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