如何在asp.net mvc2中发送激活码?
有一个发送激活码按钮。单击按钮。它应该将激活码发送给客户。我没有找到任何对此有用的文章。有人能解释一下吗?
there is a send activation code button. A click on the button. it should send the activation code to the customer. i don't find any useful article for this. anybody can explain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要生成并存储特定用户特有的某种秘密信息,然后发送电子邮件或带有返回您的应用程序的链接的内容。您可以从查询字符串中读回机密,或者链接到带有登录名和文本框的页面以输入机密。但是您想要操作该页面。
将给出的秘密和用户凭据与存储的值进行比较。
这是相当幼稚的方法,甚至没有尝试通过这种类型的设置来解决一些严重的安全问题,但对于简单的一次性电子邮件验证,您可以摆脱它。
只需要格外小心您打算在任何电子邮件中发送给用户的数据类型。
You'll need to generate and store some kind of secret information unique to a particular user, then send in an email or something with a link back to your application. You could read the secret back from the query string, or link to a page with a login and a textbox to enter it. However you want to work the page.
Compare the secret and user credentials given against the stored value.
This is fairly naive approach that doesnt even attempt to tackle some serious security concerns with this type of setup, but for a simple one off email verification you can get away with it.
Just be extremely careful about what type of data you intend to send to your users in any emails.