(
public bool ST_Login()
{
//根據用戶名
ST_strSQL =
+ this
+
try
{
ST_ExecuteSql
return true;
}
catch
{
return false;
}
}
ST_GetUserInfo()用來根據用戶名創建查詢用戶信息
public bool ST_GetUserInfo()
{
//根據用戶名創建查詢用戶信息的sql語句
ST_strSQL =
+ this
SqlConnection ST_myCn = new SqlConnection(ST_strConn);
//打開連接
ST_myCn
SqlCommand ST_myCmd = new SqlCommand(ST_strSQL
try
{
ST_myCmd
SqlDataReader reader = ST_myCmd
if(reader
{
//獲取用戶ID
this
//獲取用戶郵箱
this
return true;
}
else
{
return false;
}
}
catch(System
{
throw new Exception(e
}
finally
right
From:http://tw.wingwit.com/Article/program/net/201311/15713.html