gpt4 book ai didi

asp.net - InvalidUserName in asp.net CreateUser 使用 . @ 字符前的字符

转载 作者:行者123 更新时间:2023-12-04 06:49:22 25 4
gpt4 key购买 nike

我查看了 msdn 文档,它说在数据库中找不到用户名时会抛出 InvalidUserName,这很好,因为我创建的用户不应该存在于数据库中。

如果我使用 test@example.com,它可以工作,但如果我尝试使用 test.@example.com,Membership.CreateUser 的状态是 InvalidUserName。

最佳答案

电子邮件地址采用 username@domain 的形式,其中域至少由句点/点分隔的两部分组成。

RFC 规范说一个 .在地址的用户名部分 (@之前的部分)有效,除非 .是(用户名的)第一个或最后一个字符,因此您注意到的行为是正确的。

http://tools.ietf.org/html/rfc5322

很好的发现@David Stratton:来自他评论中的维基百科链接......

Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively (e.g. John..Doe@example.com).

关于asp.net - InvalidUserName in asp.net CreateUser 使用 . @ 字符前的字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3344843/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com