2012-04-06 53 views
0

我使用Asp.Net/C#Visual Studio 2008來構建一個應用程序。現在我想爲我的應用程序創建一個登錄頁面,我想問你們,什麼是最好的辦法。它應該與我Forms Authentication in Asp.Net去或我應該嘗試看Ajax LoginAsp.Net。哪種更合適。如果可能請讓我知道一些利弊的方法。也有人可以建議我一些鏈接爲一個好的起點。 任何建議是最受歡迎的。 謝謝Asp.Net登錄頁面,什麼是最好的方法

回答

1

我認爲你必須去Forms身份驗證。下面是它的優點。

1) users do not have to be member of a domain-based network to have access to your application. 
2) Web applications, particularly commercial sites where customers order products, want to have access to user information. Forms authentication makes these types of applications easier to create. 
3) Keep personalization cookies that contain user-specific preferences and non-sensitive data separate from authentication cookies. 
4)Consider reducing the cookie lifetime to reduce the time window in which an attacker can use a captured cookie to gain access to your application with a spoofed identity. 

列出在Web應用程序中使用Forms身份驗證的步驟?

1.Set the authentication mode in Web.config to Forms. 
2.Create a Web form to collect logon information. 
3.Create a file or database to store user names and passwords. 
4.Write code to add new users to the user file or database. 
5.Write code to authenticate users against the user file or database. 

希望這些信息對您有幫助做出決定