프로그램 세상/ASP.NET
[ASP.NET] Form 인증 방식 설정
소년포비
2009. 10. 24. 02:08
Web.Config 에다가 <authentication mode="Forms"> <forms name = ".AUTHCOOKIE" loginUrl = "Login.aspx" protection = "All" /> </authentication> <authorization> <deny users="?" /> </authorization> 추가후 </system.web> 끝나는 부분에 각 디렉토리 마다 설정을 할수 있다 <location path = "Default.apsx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> 실제 로그인 로직 string id = txtID.Text; string pwd = txtPwd.Text; if (Authenticate (id, pwd)) { FormsAuthentication.RedirectFromLoginPage (id, false); } |