Kannabiran B

Kannabiran B

  • NA
  • 31
  • 0

Check windows Username and Password Using C#.Net 2003.

May 1 2007 3:14 AM
Hi,

Im using C#.Net 2003,im using windows 2000 operating system.. i retrieved all the available windows user by using the following code and listed in the listbox..



private void button2_Click(object sender, System.EventArgs e)

{

using(DirectoryEntry root = new DirectoryEntry("WinNT://node-10"))

{

foreach (DirectoryEntry child in root.Children)

{

if (child.SchemaClassName == "User")

{

listBox1.Items.Add(child.Name);

}

}

}

}



Actually i want to check is it the right user or not from the C#.Net by programmatically..

in textbox1 im entering the username and

in textbox2 im entering the password

on clicking the ok button it should check whether the entered username and password are the right one or not,if it is the right one, then in messagebox("Valid user") else in messagebox("Invaliduser").How should i achieve this one...plz help me..its urgent...



rgrds

Kanna..

Answers (1)