如何生成随机字母特征 [英] how to generate random alphanmueric charatcers

查看:92
本文介绍了如何生成随机字母特征的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi,请帮助我在忘记密码的情况下,如何生成某些网站所生成的字母数字字符串/代码.生成的字符串/字符被运送到相关人员的地方.指向教程/视频的任何链接都是hepfull

谢谢
anoop

hi please help me to how generate alphanumeric strings/code as its done by some website in forget password type situation . where generated strings/character is shipped to concerned person.any links to tutorial/videos would be hepfull

thanks
anoop

推荐答案

在.NET中,我们可以使用LInQ
生成随机的字母数字字符
In .NET, we can generate random alphanumeric characters using LInQ

var charList = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var randomNum = new Random();
var result = new string(
    Enumerable.Repeat(charList, 8)
              .Select(s => s[randomNum.Next(s.Length)])
              .ToArray());


http://www.obviex .com/Samples/Password.aspx [ ^ ]


希望这对您有所帮助,然后接受并投票.
--Rahul D.
http://www.obviex.com/Samples/Password.aspx[^]


Hope this helps if yes then accept and vote the answer .
--Rahul D.




看帖子,

http://codeasp.net/blogs/raghav_khunger/microsoft-net/1720/c-generate-n-digit-random-字母数字字符串 [ http://stackoverflow.com/questions/1122483/c-sharp-random-string-generator [^ ]
Hi,

Look at the posts,

http://codeasp.net/blogs/raghav_khunger/microsoft-net/1720/c-generate-n-digit-random-alphanumeric-string[^]

http://stackoverflow.com/questions/1122483/c-sharp-random-string-generator[^]


这篇关于如何生成随机字母特征的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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