2011-04-29 141 views
1

嘿傢伙, 我使用dotnetnuke作爲我的CMS,由於某種原因,我想手動登錄用戶到網站,我能夠登錄,但問題是,即使我輸入無效的密碼,仍然dotnetnuke登錄我。我使用下面的代碼。以編程方式登錄在dotnetnuke

UserInfo objUser = new UserInfo(); 

objUser.Username = Login1.UserName; 
UserMembership objMembership = new UserMembership(objUser); 
objMembership.Username = Login1.UserName; 
objMembership.Password = Login1.Password; 
objUser.Membership = objMembership; 

//UserCreateStatus result = UserController.CreateUser(ref objUser);     
UserController.UserLogin(0, objUser, Request.ServerVariables["SERVER_NAME"], this.Request.UserHostAddress, true); 

回答