注释一点代码

来源:百度知道 编辑:UC知道 时间:2024/06/24 06:46:45
object objLDAP = strLDAP;//将key是LDAPString的变量赋值
object objUserID = strUserID;
object objPassword = strPassword;
ldapService.setLDAPPath (ref objLDAP);
if (ldapService.Authenticate(ref objUserID,ref objPassword))
{
string sqlSelectHr = "Select * from View_HR where fdUserID='" + strUserID + "'";
OleDbCommand selCmdHr = new OleDbCommand(sqlSelectHr,myConnectionHr);
OleDbDataReader myRdHr = selCmdHr.ExecuteReader();
if(myRdHr.Read())
{
Session["LoginID"]=strLoginID;
Session["LoginName"] = myRdHr["fdName"].ToString().Trim();
Session["UnitID"] = tempU;
Session["LoginDept"] = tempD;
Session["LoginLevel"] = tempL;
Session["LoginPhone"] = tempP;
Session["Out"] = "No";

你代码还没有贴全吧
比如 object objLDAP = strLDAP;// 比如 strLDAP =2;
ref 就是把自身引用过去 方法调用完后返回的是方法处理后的值
比如方法处理完成后 strLDAP =3 你在调用 objLDAP 现在就是3 而不是2了