如何创建登录页面 [英] How to create Login page

查看:85
本文介绍了如何创建登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是asp.net的始作俑者,您能帮我访问asp.net中的登录页面吗?

I am the begginer for asp.net could you help me for login page in asp.net

推荐答案

请参阅此线程
如何在asp.net中创建简单的登录页面? [ ^ ]

您可以参考的其他资源很少
如何在vs2008和sql server [ ^ ]
如何在C#中创建登录页面 [ ^ ]
如何使用身份验证来创建登录页面使用asp.net ..? [如何通过使用身份验证和授权....? [ ^ ]
Refer this thread
how to create simple login page in asp.net?[^]

Few more resources you can refer
how to create login page between vs2008 and sql server[^]
how to create a login page in C#[^]
how to use authentication to create login page by using asp.net..?[^]
How to create the login page by using authencation and authorization....?[^]


首先,您需要选择一个成员资格提供者.假设您选择了框架附带的基于SQL的SQL.您可以在此处阅读有关内容:将SQL成员资格与ASP.NET应用程序一起使用 [ ^ ];而不是您需要按照此处描述的步骤进行操作: http://msdn.microsoft.com/en-us/library/ff649314.aspx [ ^ ]来配置和使用提供程序.

或者,请阅读以下文章: http://www.aspfree.com/c/a/.NET/Creating-ASPNET-Login-Web-Pages-and-Basic-Configuration-/ [
First you need tho choose a membership provider. Let''s assume you choose SQL based one, that''s shipped with the framework. You can read about it here: Using SQL Membership with ASP.NET Application[^]; than you need to follow the steps described here: http://msdn.microsoft.com/en-us/library/ff649314.aspx[^] to configure and use the provider.

Alternatively read this article: http://www.aspfree.com/c/a/.NET/Creating-ASPNET-Login-Web-Pages-and-Basic-Configuration-/[^]


可以声明为全局

it can be declare globaly

SqlConnection con;
    SqlCommand cmd;
    SqlDataReader dr;
    int flag = 0;
    string s1, s2, uname, upass;

write code on btton click event it shoud be great helpful

 con = new SqlConnection("Data Source=.; Initial Catalog=krishna; Integrated Security =true;");
            con.Open();
            cmd = new SqlCommand("select *from register", con);
            dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                uname = dr[2].ToString();
                upass = dr[3].ToString();

                //if (s1.Equals(uname) && (s2.Equals(upass)))
                if (s1 == uname && s2 == upass)
                {
                    flag = 1;
                    break;

                }

            }
            if (flag == 1)
            {
                Server.Transfer("Welcometest.aspx?uname=+"+s1+""); 
                //Response.Redirect("WelcomeStudent.aspx");

            }
            else
            {
                Label3.Visible = true;
            }



在此代码中等于数据库文件以匹配数据库并转到下一页



in this code equire database file to match the database and go to the next page


这篇关于如何创建登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆