最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

【論文寫作】課程指導(dǎo)平臺的開發(fā)中系統(tǒng)部分代碼如何寫

2022-01-22 14:12 作者:計(jì)算機(jī)校園角  | 我要投稿

4《數(shù)據(jù)庫原理及應(yīng)用技術(shù)》課程指導(dǎo)平臺功能模塊具體實(shí)現(xiàn)

4.1 用戶登錄認(rèn)證部分代碼

//?數(shù)據(jù)庫連接操作幫助類

public?sealed?class?SqlHelper

{

//?執(zhí)行數(shù)據(jù)庫讀取

public?static?SqlDataReaderExecuteReader(string?connectionString,CommandType?commandType,?stringcommandText)

{

return?ExecuteReader(connectionString, commandType,commandText, (SqlParameter[])null);

?}

//?執(zhí)行數(shù)據(jù)庫讀取

public?static?SqlDataReaderExecuteReader(string?connectionString,CommandType?commandType,?stringcommandText,?paramsSqlParameter[]commandParameters)

{

????if?(connectionString ==?null?|| connectionString.Length == 0)?throw?newArgumentNullException("connectionString");

????????????SqlConnection?connection =?null;

???????? ???try

??????????? {

//?新建一個(gè)數(shù)據(jù)庫連接實(shí)例

connection =?newSqlConnection(connectionString);

//?建立連接

????????????????connection.Open();

????????????????returnExecuteReader(connection,null, commandType,commandText, commandParameters,SqlConnectionOwnership.Internal);

??????????? }

????????????catch

??????????? {

????????????????if?(connection !=?null)

//?關(guān)閉數(shù)據(jù)庫連接

connection.Close();

???? ??throw;

??? ??}

}

}

//?驗(yàn)證用戶登錄類

public?class?CheckUserLogin{

???????SqlConnection?conn;

????????public?CheckUserLogin()

?? ?????{

//讀取web.config里面的數(shù)據(jù)庫連接字串并new一個(gè)SqlConnection實(shí)例

????????????conn =

new

SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnStr"].ToString());

??????? }

//取得用戶密碼

???????public?string?getPassword(string?user_no,?stringrole)

?????? {

???????????string?password =?String.Empty;

???????????SqlDataReader?dr =?null;

???????????if?(role ==?"stu")

?????????? {

?????????????? dr =?SqlHelper.ExecuteReader(conn,CommandType.Text,?"select passwordfrom DB_STU where stu_id ="?+ user_no);

??????????}

??????????…………………………..

???????????return?password; }

}

4.2 學(xué)生作業(yè)修改功能部分代碼


【論文寫作】課程指導(dǎo)平臺的開發(fā)中系統(tǒng)部分代碼如何寫的評論 (共 條)

分享到微博請遵守國家法律
上饶市| 三门峡市| 安龙县| 喜德县| 忻城县| 济宁市| 罗源县| 安吉县| 灯塔市| 曲麻莱县| 息烽县| 蓬莱市| 伊吾县| 洞口县| 延吉市| 天水市| 祁阳县| 黎城县| 铜梁县| 通辽市| 怀化市| 白沙| 南城县| 达日县| 安图县| 明光市| 南木林县| 东宁县| 荆州市| 平遥县| 平阴县| 眉山市| 兴海县| 本溪市| 于都县| 溆浦县| 安福县| 潮安县| 玉林市| 澄迈县| 修文县|