代码结尾处一直一个波浪号删不掉
using System;using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class DL : System.Web.UI.Page
{
Random random = new Random(); //声明随机类对象
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
lblCheckCode.Text = random.Next(1000, 9999).ToString();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string userName = txtUser.Text;
string userPwd = txtPwd.Text;
if (txtCheckCode.Text != lblCheckCode.Text)
{
Response.Write("<script>alert('验证码错误')</script>");
lblCheckCode.Text = random.Next(1000, 9999).ToString();
}
else
{
SqlConnection con = new SqlConnection("Data Source=SC-201504091332;Initial Catalog=db_SIS;Integrated Security=True");
string sqlstr = "select * from tb_Power where sysName='" + userName + "'";
SqlDataAdapter sda = new SqlDataAdapter(sqlstr, con);
DataSet ds = new DataSet();
sda.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0][2].ToString() == userPwd)
{
Response.Redirect("default.aspx");
}
else
{
Response.Write("<script>alert('密码错误')</script>");
}
}
else
{
Response.Write("<script>alert('用户名错误')</script>");
}
lblCheckCode.Text = random.Next(1000, 9999).ToString();
}
}~
错误 1 应输入 } F:\作业\淘宝\DL.aspx.cs 49 2 F:\作业\淘宝\
错误 2 未能找到类型或命名空间名称“SqlConnection”(是否缺少 using 指令或程序集引用?) F:\作业\淘宝\DL.aspx.cs 27 13 F:\作业\淘宝\
错误 3 未能找到类型或命名空间名称“SqlConnection”(是否缺少 using 指令或程序集引用?) F:\作业\淘宝\DL.aspx.cs 27 37 F:\作业\淘宝\
错误 4 未能找到类型或命名空间名称“SqlDataAdapter”(是否缺少 using 指令或程序集引用?) F:\作业\淘宝\DL.aspx.cs 29 13 F:\作业\淘宝\
错误 5 未能找到类型或命名空间名称“SqlDataAdapter”(是否缺少 using 指令或程序集引用?) F:\作业\淘宝\DL.aspx.cs 29 38 F:\作业\淘宝\
错误 6 未能找到类型或命名空间名称“DataSet”(是否缺少 using 指令或程序集引用?) F:\作业\淘宝\DL.aspx.cs 30 13 F:\作业\淘宝\
错误 7 未能找到类型或命名空间名称“DataSet”(是否缺少 using 指令或程序集引用?) F:\作业\淘宝\DL.aspx.cs 30 30 F:\作业\淘宝\