를 반환하지 않습니다. 경우에 따라 UserId
을 반환하고 다른 경우에는 -1
을 반환합니다. 로그인 페이지가 있으므로 응용 프로그램에 로그인 한 사용자의 UserId
을 가져와야합니다.WebSecurity.GetUserID은 (HttpContext.Current.User.Identity.Name)는 항상 내가 <code>WebMatrix</code> 응용 프로그램이 있고 나는 <code>UserID</code>을 잡아 <code>WebSecurity.GetUserId(Http.Current.User.Identity.Name)</code>을 사용하고있는 사용자 ID
var UserId = WebSecurity.GetUserId(HttpContext.Current.User.Identity.Name);
var User = WebSecurity.CurrentUserName;
var UserEmail = WebSecurity.CurrentUserName;
var dbApp = Database.Open("ApplicationServices");
var selectUser = "SELECT UserId, UserName, Location FROM LocationTable, UserTable WHERE (UserId) = (@0) AND (UserLocation) = (Id)";
var person = dbApp.QuerySingle(selectUser, UserId);
왜 일치하지 않습니다 : 여기에
내 코드?
샘플 코드가 있습니까? – tnbumbray
[여기에 좋은 샘플] (http://stackoverflow.com/a/13292334/6415885) – SqlOnly