是否可以使用 Membership API 更改用户名 [英] Is it possible to change the username with the Membership API

查看:36
本文介绍了是否可以使用 Membership API 更改用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ASP.NET 中使用默认的 sql 成员资格提供程序,我想提供一个页面来更改用户的用户名.我相信我可以使用自定义提供程序执行此操作,但可以使用默认提供程序执行此操作吗?

I am using the default sql membership provider with ASP.NET and I would like to provide a page to change the user's username. I believe I am sure I could do this with a custom provider, but can this be done with the default provider?

我的问题的第二部分是:我应该允许用户在创建帐户后更改其用户名吗?

Second part of my question is: Should I allow users to change their username after the account is created?

推荐答案

默认的 SQL Membership Provider 确实不允许更改用户名.但是,如果您在您的站点上有一个有效的参数允许它,则没有内在的理由阻止用户更改他们的用户名.SQL 数据库中没有一个表以用户名作为键,一切都基于用户的 ID,因此从实现的角度来看,这将相当容易.

It's true that the default SQL Membership Provider does not allow username changes. However, there's no intrinsic reason to prevent users from changing their usernames if you have a valid argument, on your site, to allow it. None of the tables in the SQL database have the username as a key, everything is based on the user's ID, so from an implementation perspective it would be fairly easy.

这篇关于是否可以使用 Membership API 更改用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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