TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sowmya Sirsi
NA
173
39.3k
Generate Random Password Including login username
May 25 2021 9:43 AM
Hi Team,
I am stuck with in the fetching the username while generating the new password.
Please suggest me. Is there any other option to implement so that it includes username
Code:
protected string RandomPassword(int length)
{
string validChars = lblUserNameData.Text + "0123456789!@#$%^&*?";
Random random = new Random();
char[] chars = new char[length];
for (int i = 0; i < length; i++)
{
chars[i] = validChars[random.Next(0, validChars.Length)];
}
return new string(chars);
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
int length = 10;
log.Debug("Entering btnSubmit_Click");
string NewPwd = RandomPassword(length);
}
Reply
Answers (
1
)
Web API Login using phone number or email id.
if .net core is open source what is the use of visual studio enterpris