473,796 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check Windows username and password using C#.Net 2003

14 New Member
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..
May 2 '07 #1
2 4635
kenobewan
4,871 Recognized Expert Specialist
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?
May 2 '07 #2
kannabiran
14 New Member
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..
May 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3713
by: Reader | last post by:
I have an application that allows a user to enter a user name, user password, and the domain or machine name. From this information I would like to verify the user account and password is valid. This must work for either a domain or a local machine account. I have tried to find examples from the web and it seems every example that I have found does not work or produces odd results. I have tested each of these on Windows 2000, Windows XP,...
5
2699
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the Administration group (on server side) to have the necessary authorization to start a Windows Service (I don't understand why "Power User" rights are not enough to do the same thing) Although I'm able to start a service using windows 2000 server...
0
1597
by: None | last post by:
Hi, I have written a c# code to find the given username and password is correct or not. (i.e the given username and password will be checked against the active directory) But i don't know how to check the username and password for WorkGroup machine. The difficulty i'm facing is that i don' know how to assign correct path to DirectoryEntry Class constructor This is working fine for Domain machine
3
8469
by: Carl | last post by:
Using VB .NET how can I enable my program to access a share on another machine and pass the user name and password. I have a computer and share, say "\\computer\share" so I can copy files from it but to access it I have to log on with a UserName and Password. I do not want the user to have to enter the user name or password, so how can I pass this in code? Thanks, -Carl
3
2016
by: Vinod R.Shenoy | last post by:
Hi All, Came across a post wherin you had helped somebody with a similar problem and was wondering if you could help us out with it. Our problem is , We have a development SQL Server 2000 (running on Win2K SP4) machine that we want to run on a Windows 2003 server machine and access it via our internal LAN. We have opened the firewall to allow our applications
1
7852
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
1
2472
by: Carl | last post by:
In ASP.Net, how can we connect to a nas that uses cifs for its file sharing protocol. Currently we should be able to provide the ip address or hostname of the nas, the sharename along with any directories to go directly into that sharename, and the username and password. This username and password will not be on the server hosting the asp.net pages from the local usernames and password. Currently we can only try to impersonate a local...
0
13850
JamieHowarth0
by: JamieHowarth0 | last post by:
I have been trying to find a solution to this on the Internet for months. Literally, ages and ages and ages, praying that someone in the open-source community has enough knowledge to put together an LDAP connector for MySQL Community to connect to Active Directory. Alas, nothing. So I figured I'd try doing something similar. My business problem is/was as follows: I use Active Directory on Windows Server 2003 to manage my small corporate...
2
7668
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the PasswordRecovery with a Password reset required; a temporary password is sent to the account on file. I want an extra layer of security to accommodate the very unlikely contingency that someone's e-mail account is compromised. Challenging with the...
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.