相關變數說明:
result = usersystem.singin( tempusername , temppassword , out data ); 得到最後登入資訊的值
userid :datarow row = data.tables[ "表名" ].rows[ 0 ];
userid = convert.toint32( row[ common.admincommon.userdata.user_id_field ] );
在登入方法中加入addlog(result,tempusername,userid) 方法
logdata 類:
public class logdata : dataset
private void buildtable()
}//得到ip
public string getip()
else
}catch(exception error)
return ip;
}//新增日誌方法
private void addlog(int result , string tempusername , int userid)
else
switch ( result )
dr[logdata.log_user_id_field]= userid;
dr[logdata.log_user_name_field] =tempusername;
dr[logdata.log_valid_field] =valid;
dr[logdata.log_user_ip_field] =getip();
dr[logdata.log_reason_field] = reason;
logdatatable.rows.add( dr );
logfacade clslogfacade = new logfacade();
clslogfacade.insertlog( logdata );
//insertlog方法
public bool insertlog(logdata log)
insertcommand = new sqlcommand( "procadminloginsert",this.dataconn );
insertcommand.commandtype = commandtype.storedprocedure;
sqlparametercollection sqlparams = insertcommand.parameters;
sqlparams.add(new sqlparameter(paramchg(logdata.log_user_id_field) ,sqldbtype.int));
sqlparams.add(new sqlparameter(paramchg(logdata.log_user_name_field) ,sqldbtype.nvarchar,50));
sqlparams.add(new sqlparameter(paramchg(logdata.log_valid_field) ,sqldbtype.tinyint));
sqlparams.add(new sqlparameter(paramchg(logdata.log_user_ip_field) ,sqldbtype.nvarchar,50));
sqlparams.add(new sqlparameter(paramchg(logdata.log_reason_field) ,sqldbtype.nvarchar,50));
sqlparams[paramchg(logdata.log_user_id_field)].sourcecolumn = logdata.log_user_id_field;
sqlparams[paramchg(logdata.log_user_name_field)].sourcecolumn = logdata.log_user_name_field;
sqlparams[paramchg(logdata.log_valid_field)].sourcecolumn = logdata.log_valid_field;
sqlparams[paramchg(logdata.log_user_ip_field)].sourcecolumn = logdata.log_user_ip_field;
sqlparams[paramchg(logdata.log_reason_field)].sourcecolumn = logdata.log_reason_field;
// //從儲存過程獲取返回值用以判斷
sqlparameter paramreturnvalue = new sqlparameter( "@returnvalue" , sqldbtype.int );
paramreturnvalue.direction = parameterdirection.returnvalue;
insertcommand.parameters.add( paramreturnvalue );
sqldataadapter.insertcommand = insertcommand;
sqldataadapter.update(log ,logdata.log_info_table);
//定義變數y來接收儲存過程的返回值
int y = 0;
y = convert.toint32( insertcommand.parameters[ "@returnvalue" ].value );
if(y == 0)
else
return result;
}
登入日誌管理功能 3
分頁控制項 namespace web.enterprise.modules set 當前的頁 public int currentpage set 總的頁數 public int pagecount set 初始化第1頁的值為0 public int pagebase setelse privat...
Hbase API管理功能1
1.hbase建表涉及到 表結構 列簇結構的定義,這些定義關係到表和列簇內的資料如何儲存以及何時儲存。2.hbase中的資料最終儲存到表中的主要原因是 控制表中的列以到達共享表內的某些特性。3.客服端與伺服器 伺服器與伺服器之間進行通訊,都是用hadoop rpc框架,引數都實現了writable介...
使用php ajax實現登入功能教程 1
php登入原始碼 下面是chklogin.php頁面 session start connect mysql connect 127.0.0.1 root 123 if connect mysql select db design,connect query select from ta user ...