C#登陆系统问题
一行或者一段把作用写出来,麻烦了,最好标一下private SqlConnection conn = null;
public SqlConnection Conn
{
get {
if (conn == null) { conn = new SqlConnection(connStr); }
return conn; }
//set { conn = value; }
}
public bool OpenDB() {
if (Conn.State == ConnectionState.Closed)
{
try
{
Conn.Open();
return true;
}
catch (Exception)
{
return false;
}
}
else { return true; }
}
}
}