Check Windows username and password using C#.Net 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kannabiran
    New Member
    • Jan 2007
    • 14

    Check Windows username and password using C#.Net 2003

    Hi,

    Im using C# Windows.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(o bject sender, System.EventArg s e)

    {

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

    {

    foreach (DirectoryEntry child in root.Children)

    {

    if (child.SchemaCl assName == "User")

    {

    listBox1.Items. Add(child.Name) ;

    }

    }

    }

    }



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

    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("Val id user") else in messagebox("Inv aliduser")...an d also mention if i need to refer any namespaces over here...How should i achieve this one...plz help me..its urgent...



    rgrds

    Kanna..
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    I don't unerstand your requirement, if someone has a windows password why would they want to enter it again. Do you have active directory?

    Comment

    • kannabiran
      New Member
      • Jan 2007
      • 14

      #3
      Originally posted by kenobewan
      I don't unerstand your requirement, if someone has a windows password why would they want to enter it again. Do you have active directory?
      Yes,im Having Active directory..just i want to check whether the user is a valid user or not by programatically ..as per as the windows login i have to achieve that by programmaticall y..

      regrds
      Kanna..

      Comment

      Working...