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

📄 webform2.aspx.cs

📁 本程序只要配置好IIS就可以直接使用,是一个在线网上考试系统
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace exam
{
	/// <summary>
	/// WebForm2 的摘要说明。
	/// </summary>
	public class WebForm2 : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.TextBox TextBox1;
		protected System.Web.UI.WebControls.TextBox TextBox2;
		protected System.Web.UI.WebControls.TextBox TextBox3;
		protected System.Web.UI.WebControls.TextBox TextBox4;
		protected System.Web.UI.WebControls.TextBox TextBox5;
		protected System.Web.UI.WebControls.TextBox TextBox6;
		protected System.Web.UI.WebControls.TextBox TextBox7;
		protected System.Web.UI.WebControls.TextBox TextBox8;
		protected System.Web.UI.WebControls.TextBox TextBox9;
		protected System.Web.UI.WebControls.Button Button2;
		protected System.Timers.Timer timer1;
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Button Button1;
		public static int a=2;public static int b=59;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
//			a=2;
//			b=59;
//			this.Label1.Text=a+":"+b;
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.timer1 = new System.Timers.Timer();
			((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
			this.Button1.Click += new System.EventHandler(this.Button1_Click);
			this.TextBox9.TextChanged += new System.EventHandler(this.TextBox9_TextChanged);
			this.Button2.Click += new System.EventHandler(this.Button2_Click);
			// 
			// timer1
			// 
			this.timer1.Enabled = true;
			this.timer1.Interval = 1000;
			this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
			this.Load += new System.EventHandler(this.Page_Load);
			((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit();

		}
		#endregion

		bool bo;
		DataSet ds;

		private void Button1_Click(object sender, System.EventArgs e)
		{
			ECClass.Users  em=new ECClass.Users ();
			bo=em.db_update(this.TextBox1.Text,this.TextBox2.Text,this.TextBox3.Text,this.TextBox4.Text,this.TextBox5.Text,this.TextBox6.Text,this.TextBox7.Text,"",this.TextBox8.Text);
			if (bo==true)
			{
				this.Response.Write("成功");
			}
			else
			{
				this.Response.Write("不成功");
			}
		}

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

		private void Button2_Click(object sender, System.EventArgs e)
		{
			this.Response.Write("成功");
		}

		private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
		{
			this.Label1.Text="asdfasdfasdfasdf";
//			this.Label1.Text=a+":"+b;
//			if(b<=0)
//			{
//				b=b-1;
//			}
//			else
//			{
//				a=a-1;
//				b=59;
//			}
//			if(a<=0 && b==0)
//			{
//				this.timer1.Enabled=false;
//			}
		}
	}
}

⌨️ 快捷键说明

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