Use Authentication's Forms Authentication Mode

xiaoxiao2021-03-05  27

These days helped a friend wrote a web applet and re-reviewed .NET. Today, I want to use the Authentication's Forms Authentication mode to verify the program. But I have encountered a very, very small question, delayed the time in half a day. What is the specific problem, take into account your dignity, I will give it in the article. Let's take a look at how to use the Authentication's Forms authentication mode. First, configure programs in the application's configuration file (web.config). The specific use: Configure the Authentication node, indicating the use of the Forms verification mode, the specific meaning of the Forms node can be available to search Configure the Authorization node, refuse anonymous access then, you can verify the user in the login.aspx page, and database, I use the method is : If (Validatelogin (UID, PWD)) // This method is based on the recorded UID, the PWD lookup database, if there is a return {Formsauthentication.seTauthCookie (UID, FALSE); // Setting Cookie, you can also use RedirectFromLoginPage (UID, FALSE) Directly to the default page response.Redirect ("index.aspx"); // redirect} This will be directed to the login.aspx page if the user wants to access resource if the user wants to access the resource. The problem I encountered is: Write To write The result can I know, I don't know if you have encountered such a small problem.

转载请注明原文地址:https://www.9cbs.com/read-33606.html

New Post(0)