应输入 class,delegate,enum,interface 或 struct

using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class 密码修改 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (txtpassword.Text=="")
Label1.Text="你必须输入原密码!";
else if( password1.Text!==password2.Text)
Label1.Text="两次输入要一致!";
string ConnSql = System.Configuration.ConfigurationManager.ConnectionStrings["StudentDBConnectionString"].ToString();
SqlConnection Conn = new SqlConnection(ConnSql);
SqlCommand SelectCom = new SqlCommand("select * from userinfo", Conn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
Conn.Open();
string UpdateSql = "update users set userid='" + password1.Text + "'";
da.SelectCommand = SelectCom;
da.Fill(ds);
SqlCommand UpdateCom = new SqlCommand(UpdateSql, Conn);
da.UpdateCommand = UpdateCom;
da.UpdateCommand.ExecuteNonQuery();
Conn.Close();
Response.Write("<script language=javascript>alert('密码已修改,请单击“返回”回到登录面!');</script>");
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("用户登录.aspx");
}
}
:\Users\delll\Desktop\新建文件夹 (3)\密码修改.aspx.cs(43,15): error CS1518: 应输入 class、delegate、enum、interface 或 struct
c:\Users\delll\Desktop\新建文件夹 (3)\密码修改.aspx.cs(47,1): error CS1022: 应输入类型、命名空间定义或文件尾

第1个回答  2012-12-24
不知道