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

📄 管理员.cs

📁 本论文叙述了联机考试系统的现状以及C#语言的概况。重点介绍了联机考试系统的实现过程:包括系统分析、 系统调查、 数据流程分析、功能设计、 数据库设计、 系统物理配置方案、 系统实现、 系统测试和调试。
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data;
using System.Windows;

namespace 自动化考试系统
{
	/// <summary>
	/// 管理员 的摘要说明。
	/// </summary>
	public class guanliyuan : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Button xinjian;
		private System.Windows.Forms.Button xugai;
		private System.Windows.Forms.Button tuichu;
		private System.Windows.Forms.Button bangzhu;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label ps;
		private System.Windows.Forms.TextBox textBox2;

		public static Point a=new Point(150,120);
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public guanliyuan()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

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

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

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(guanliyuan));
			this.label1 = new System.Windows.Forms.Label();
			this.xinjian = new System.Windows.Forms.Button();
			this.xugai = new System.Windows.Forms.Button();
			this.tuichu = new System.Windows.Forms.Button();
			this.bangzhu = new System.Windows.Forms.Button();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.ps = new System.Windows.Forms.Label();
			this.textBox2 = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.BackColor = System.Drawing.Color.Transparent;
			this.label1.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.Location = new System.Drawing.Point(288, 40);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(240, 64);
			this.label1.TabIndex = 0;
			this.label1.Text = "欢迎管理员";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// xinjian
			// 
			this.xinjian.BackColor = System.Drawing.Color.Transparent;
			this.xinjian.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.xinjian.Location = new System.Drawing.Point(8, 144);
			this.xinjian.Name = "xinjian";
			this.xinjian.Size = new System.Drawing.Size(112, 32);
			this.xinjian.TabIndex = 1;
			this.xinjian.Text = "创建新用户";
			this.xinjian.Click += new System.EventHandler(this.xinjian_Click);
			// 
			// xugai
			// 
			this.xugai.BackColor = System.Drawing.Color.Transparent;
			this.xugai.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.xugai.Location = new System.Drawing.Point(8, 240);
			this.xugai.Name = "xugai";
			this.xugai.Size = new System.Drawing.Size(112, 32);
			this.xugai.TabIndex = 2;
			this.xugai.Text = "修改用户";
			this.xugai.Click += new System.EventHandler(this.xugai_Click);
			// 
			// tuichu
			// 
			this.tuichu.BackColor = System.Drawing.Color.Transparent;
			this.tuichu.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.tuichu.ForeColor = System.Drawing.Color.White;
			this.tuichu.Location = new System.Drawing.Point(24, 320);
			this.tuichu.Name = "tuichu";
			this.tuichu.Size = new System.Drawing.Size(88, 32);
			this.tuichu.TabIndex = 3;
			this.tuichu.Text = "退  出";
			this.tuichu.Click += new System.EventHandler(this.tuichu_Click);
			// 
			// bangzhu
			// 
			this.bangzhu.BackColor = System.Drawing.Color.Transparent;
			this.bangzhu.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.bangzhu.Location = new System.Drawing.Point(24, 400);
			this.bangzhu.Name = "bangzhu";
			this.bangzhu.Size = new System.Drawing.Size(88, 32);
			this.bangzhu.TabIndex = 4;
			this.bangzhu.Text = "帮  助";
			// 
			// label2
			// 
			this.label2.BackColor = System.Drawing.Color.Transparent;
			this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label2.Location = new System.Drawing.Point(232, 160);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(432, 32);
			this.label2.TabIndex = 5;
			this.label2.Text = "要注册新用户,请单击本窗口左边的“创建新用户”选项";
			// 
			// label3
			// 
			this.label3.BackColor = System.Drawing.Color.Transparent;
			this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label3.Location = new System.Drawing.Point(232, 240);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(432, 32);
			this.label3.TabIndex = 6;
			this.label3.Text = "要查看和个性有关用户的信息,请单击本窗口左边的“修改用户”";
			// 
			// label4
			// 
			this.label4.BackColor = System.Drawing.Color.Transparent;
			this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label4.Location = new System.Drawing.Point(232, 324);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(432, 32);
			this.label4.TabIndex = 7;
			this.label4.Text = "要退出系统,请单击“退出”";
			// 
			// label5
			// 
			this.label5.BackColor = System.Drawing.Color.Transparent;
			this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label5.Location = new System.Drawing.Point(232, 406);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(432, 32);
			this.label5.TabIndex = 8;
			this.label5.Text = "要获取更多信息,请单击“帮助”";
			// 
			// ps
			// 
			this.ps.BackColor = System.Drawing.Color.Transparent;
			this.ps.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.ps.Location = new System.Drawing.Point(280, 248);
			this.ps.Name = "ps";
			this.ps.Size = new System.Drawing.Size(64, 32);
			this.ps.TabIndex = 10;
			this.ps.Text = "密码:";
			this.ps.Visible = false;
			// 
			// textBox2
			// 
			this.textBox2.Location = new System.Drawing.Point(384, 248);
			this.textBox2.Name = "textBox2";
			this.textBox2.PasswordChar = '*';
			this.textBox2.Size = new System.Drawing.Size(136, 21);
			this.textBox2.TabIndex = 11;
			this.textBox2.Text = "";
			this.textBox2.Visible = false;
			// 
			// guanliyuan
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(696, 544);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.bangzhu);
			this.Controls.Add(this.tuichu);
			this.Controls.Add(this.xugai);
			this.Controls.Add(this.xinjian);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.ps);
			this.Controls.Add(this.textBox2);
			this.ForeColor = System.Drawing.Color.White;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.Name = "guanliyuan";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.guanliyuan_Load);
			this.ResumeLayout(false);

		}
		#endregion


		private void xinjian_Click(object sender, System.EventArgs e)
		{
			chuangjianyonghu an=new chuangjianyonghu();
			an.Show();
			an.Location=a;
			
		}

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

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

//		private void button1_Click(object sender, System.EventArgs e)
//		{
//			try
//			{
//				string str="provider=Microsoft.Jet.OLEDB.4.0;Data Source=ws.mdb";
//				string strsql="select * from ws where name='"+this.textBox1.Text+"'";
//				OleDbConnection con=new OleDbConnection(str);
//				OleDbCommand com=new OleDbCommand(strsql,con);
//				con.Open();
//				OleDbDataReader der=com.ExecuteReader();
//				bool ean=der.HasRows;
//				der.Close();
//				if(ean)
//				{
//					MessageBox.Show("用户名已存在,请重新输入用户名");
//					this.textBox1.Focus(); 
//				}
//
//				else if(this.textBox2.Text!=this.textBox3.Text)
//				{
//				MessageBox.Show("两次密码不一样","信息");
//				}
//				else
//				{
//					string sql="insert into ws values('"+this.textBox1.Text+"','"+this.textBox2.Text+"','"+this.lie.Text+"')";
//					OleDbCommand and=new OleDbCommand(sql,con);
//					and.ExecuteNonQuery();
//					MessageBox.Show(" 保存成功","信息");
//					con.Close();
//				}
//			}
//			catch(System.Exception ee)
//			{
//				MessageBox.Show(ee.ToString());
//			}
//		}

		private void xugai_Click(object sender, System.EventArgs e)
		{
			yonghusousuo nu=new yonghusousuo();
			nu.Show();
			nu.Location=a;
			
		}

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


	}
}

⌨️ 快捷键说明

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