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

📄 myform.cs

📁 C#做的一个文本编辑器
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.passwordText.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("passwordText.Dock")));
			this.passwordText.Enabled = ((bool)(resources.GetObject("passwordText.Enabled")));
			this.passwordText.Font = ((System.Drawing.Font)(resources.GetObject("passwordText.Font")));
			this.passwordText.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("passwordText.ImeMode")));
			this.passwordText.Location = ((System.Drawing.Point)(resources.GetObject("passwordText.Location")));
			this.passwordText.MaxLength = ((int)(resources.GetObject("passwordText.MaxLength")));
			this.passwordText.Multiline = ((bool)(resources.GetObject("passwordText.Multiline")));
			this.passwordText.Name = "passwordText";
			this.passwordText.PasswordChar = ((char)(resources.GetObject("passwordText.PasswordChar")));
			this.passwordText.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("passwordText.RightToLeft")));
			this.passwordText.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("passwordText.ScrollBars")));
			this.passwordText.Size = ((System.Drawing.Size)(resources.GetObject("passwordText.Size")));
			this.passwordText.TabIndex = ((int)(resources.GetObject("passwordText.TabIndex")));
			this.passwordText.Text = resources.GetString("passwordText.Text");
			this.passwordText.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("passwordText.TextAlign")));
			this.passwordText.Visible = ((bool)(resources.GetObject("passwordText.Visible")));
			this.passwordText.WordWrap = ((bool)(resources.GetObject("passwordText.WordWrap")));
			// 
			// sureButton
			// 
			this.sureButton.AccessibleDescription = resources.GetString("sureButton.AccessibleDescription");
			this.sureButton.AccessibleName = resources.GetString("sureButton.AccessibleName");
			this.sureButton.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("sureButton.Anchor")));
			this.sureButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("sureButton.BackgroundImage")));
			this.sureButton.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("sureButton.Dock")));
			this.sureButton.Enabled = ((bool)(resources.GetObject("sureButton.Enabled")));
			this.sureButton.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("sureButton.FlatStyle")));
			this.sureButton.Font = ((System.Drawing.Font)(resources.GetObject("sureButton.Font")));
			this.sureButton.Image = ((System.Drawing.Image)(resources.GetObject("sureButton.Image")));
			this.sureButton.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("sureButton.ImageAlign")));
			this.sureButton.ImageIndex = ((int)(resources.GetObject("sureButton.ImageIndex")));
			this.sureButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("sureButton.ImeMode")));
			this.sureButton.Location = ((System.Drawing.Point)(resources.GetObject("sureButton.Location")));
			this.sureButton.Name = "sureButton";
			this.sureButton.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("sureButton.RightToLeft")));
			this.sureButton.Size = ((System.Drawing.Size)(resources.GetObject("sureButton.Size")));
			this.sureButton.TabIndex = ((int)(resources.GetObject("sureButton.TabIndex")));
			this.sureButton.Text = resources.GetString("sureButton.Text");
			this.sureButton.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("sureButton.TextAlign")));
			this.sureButton.Visible = ((bool)(resources.GetObject("sureButton.Visible")));
			this.sureButton.Click += new System.EventHandler(this.sureButton_Click);
			// 
			// concelButton
			// 
			this.concelButton.AccessibleDescription = resources.GetString("concelButton.AccessibleDescription");
			this.concelButton.AccessibleName = resources.GetString("concelButton.AccessibleName");
			this.concelButton.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("concelButton.Anchor")));
			this.concelButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("concelButton.BackgroundImage")));
			this.concelButton.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("concelButton.Dock")));
			this.concelButton.Enabled = ((bool)(resources.GetObject("concelButton.Enabled")));
			this.concelButton.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("concelButton.FlatStyle")));
			this.concelButton.Font = ((System.Drawing.Font)(resources.GetObject("concelButton.Font")));
			this.concelButton.Image = ((System.Drawing.Image)(resources.GetObject("concelButton.Image")));
			this.concelButton.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("concelButton.ImageAlign")));
			this.concelButton.ImageIndex = ((int)(resources.GetObject("concelButton.ImageIndex")));
			this.concelButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("concelButton.ImeMode")));
			this.concelButton.Location = ((System.Drawing.Point)(resources.GetObject("concelButton.Location")));
			this.concelButton.Name = "concelButton";
			this.concelButton.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("concelButton.RightToLeft")));
			this.concelButton.Size = ((System.Drawing.Size)(resources.GetObject("concelButton.Size")));
			this.concelButton.TabIndex = ((int)(resources.GetObject("concelButton.TabIndex")));
			this.concelButton.Text = resources.GetString("concelButton.Text");
			this.concelButton.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("concelButton.TextAlign")));
			this.concelButton.Visible = ((bool)(resources.GetObject("concelButton.Visible")));
			this.concelButton.Click += new System.EventHandler(this.concelButton_Click);
			// 
			// myForm
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.concelButton);
			this.Controls.Add(this.sureButton);
			this.Controls.Add(this.passwordText);
			this.Controls.Add(this.nameText);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.nameLabel);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximizeBox = false;
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimizeBox = false;
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "myForm";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new myForm());
			
		}

		private void sureButton_Click(object sender, System.EventArgs e)
		{
			try
			{
				SqlConnection conn = new SqlConnection("Server=(local);Integrated Security=SSPI;database=文本编辑系统");
				string cmdText="SELECT * FROM userTable WHERE username = '"+nameText.Text+"' and userpassword = '" + passwordText.Text +"'";	
				SqlCommand cmd = new SqlCommand(cmdText,conn);   
				conn.Open();
				if(nameText.Text==""||passwordText.Text=="")
					MessageBox.Show("输入不能为空!");
				else if (cmd.ExecuteScalar() == null)
				{
					MessageBox.Show("登录信息验证错误!");
				}
				else
				{
					this.Hide();
					myText my=new myText();
					my.Show();
				}

			}
			catch(Exception exc)
			{
				string temp=exc.ToString();
				MessageBox.Show(temp);
			}
		}

		private void concelButton_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}
	}
	
}

⌨️ 快捷键说明

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