C#这个代码怎么定义类?要具体的

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSys... using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using System.Data;
using System.Data.SqlClient;

namespace EMsystem.WebManager
{

protected void Page_Load(object sender, EventArgs e)
{
if (Session["userName"] == null)
{
Response.Redirect("../Login.aspx");
}
if (!IsPostBack)
{
SqlConnection conn = BaseClass.DBCon();
conn.Open();
SqlCommand cmd = new SqlCommand("select * from tb_Lesson", conn);
SqlDataReader sdr = cmd.ExecuteReader();
this.ddlkm.DataSource = sdr;
this.ddlkm.DataTextField = "LessonName";
this.ddlkm.DataValueField = "ID";
this.ddlkm.DataBind();
this.ddlkm.SelectedIndex = 0;
conn.Close();
}
}
protected void btnconfirm_Click(object sender, EventArgs e)
{
if (txtsubject.Text == "" || txtAnsA.Text == "" || txtAnsB.Text == "" || txtAnsC.Text == "" || txtAnsD.Text == "")
{
MessageBox.Show("请将信息填写完整");
return;
}
else
{
string isfb = "";
if (cbFB.Checked == true)
isfb = "1";
else
isfb = "0";
string str = "insert into tb_test(testContent,testAns1,testAns2,testAns3,testAns4,rightAns,pub,testCourse,class) values('" + txtsubject.Text.Trim() + "','" + txtAnsA.Text.Trim() + "','" + txtAnsB.Text.Trim() + "','" + txtAnsC.Text.Trim() + "','" + txtAnsD.Text.Trim() + "','" + rblRightAns.SelectedValue.ToString() + "','" + isfb + "','" + ddlkm.SelectedItem.Text + "','单选题')";
BaseClass.OperateData(str);
btnconcel_Click(sender, e);
}
}
protected void btnconcel_Click(object sender, EventArgs e)
{
txtsubject.Text = "";
txtAnsD.Text = "";
txtAnsC.Text = "";
txtAnsB.Text = "";
txtAnsA.Text = "";
}
展开
 我来答
丶风清云淡丨so
2014-04-25 · TA获得超过156个赞
知道小有建树答主
回答量:192
采纳率:0%
帮助的人:151万
展开全部
http://www.360doc.com/content/13/0207/08/19147_264646769.shtml
仔细去看看吧,都是很基础的内容。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式