简体   繁体   English

在ASP.NET中自定义登录控件

[英]Customizing the Login Control in ASP.NET

I'm making a Library Management System using ASP.NET using C#. 我正在使用C#使用ASP.NET制作图书馆管理系统。 I have a problem creating a custom login page in my website. 我在网站上创建自定义登录页面时遇到问题。 I've tried using the ASP.NET Web Configuration but my boss doesnt allow me to install the Aspnet_regsql.exe in the main database. 我尝试使用ASP.NET Web配置,但老板不允许我在主数据库中安装Aspnet_regsql.exe。

I have two tables, one table for the username and password and the other one is for the username status (in case the username is deleted or not used anymore). 我有两个表,一个表用于用户名和密码,另一个表用于用户名状态(以防用户名被删除或不再使用)。 So is there any alternatives or workaround? 有没有其他选择或解决方法?

You could use a separate database for the aspnet login part. 您可以为aspnet登录部分使用单独的数据库。 This way your boss doesn't have to worry about .NET adding procedures and tables to an existing database. 这样,您的老板就不必担心.NET向现有数据库中添加过程和表。 I wouldn't recommend writing your own from scratch as there is always a danger of creating security vulnerabilities that hackers could later exploit. 我不建议您从头开始编写自己的脚本,因为始终存在创建安全漏洞的危险,黑客以后可以利用这些漏洞。

I think its good idea to implement your own role and membership provider. 我认为实现自己的角色和成员资格提供者是个好主意。 Its easy, you have to overide just a few methots and create your own view. 这很容易,您只需覆盖几个小方法并创建自己的视图。 Try this tutorial for start. 试试这个教程开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM