HI,
Why is this password authentication not working as I am sending? I am trying
to change the password and yet it is not working. What am I doing wrong?
TIA
Roy
using System;
public class Authenticator
{
private string Password;
public bool IsPasswordCorre ct(string password)
{
return (password == Password) ? true : false;
}
public bool ChangePassword( string oldPassword, string newPassword)
{
if (oldPassword == Password)
{
Password = newPassword;
Console.WriteLi ne("Inside EQUAL {0} ",Password) ;
Console.ReadLin e();
return true;
}
else
{
Console.WriteLi ne("Inside NOT EQUAL {0} ",Password) ;
Console.ReadLin e();
return false;
}
}
}
class clsMain
{
static void Main()
{
Authenticator Simon = new Authenticator() ;
bool Done;
Done= Simon.ChangePas sword("", "MyNewPassword" );
if (Done==true)
Console.WriteLi ne("password for Simon changed");
else
Console.WriteLi ne("Failed to change password for Simon");
if (Simon.IsPasswo rdCorrect("what pw"))
Console.WriteLi ne("Verified ");
else
Console.WriteLi ne("NOT Verified ");
Console.ReadLin e();
}
} 3 2014
"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:nO******** ***********@wag ner.videotron.n et... HI,
Why is this password authentication not working as I am sending? I am trying to change the password and yet it is not working. What am I doing wrong?
private string Password; public bool ChangePassword( string oldPassword, string newPassword) { if (oldPassword == Password) {
Authenticator Simon = new Authenticator() ;
bool Done;
Done= Simon.ChangePas sword("", "MyNewPassword" );
I assume Done is returning false. That is because you are comparing an empty
length string to a null string, which will return false;
SP
Hi,
Yes that is right it is returning false. So how would I do it. I took this
example straight out of a book. So much for that. :)
Roy
"SP" <ec***********@ hotmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. .. "Roy Gourgi" <ro***@videotro n.ca> wrote in message news:nO******** ***********@wag ner.videotron.n et... HI,
Why is this password authentication not working as I am sending? I am trying to change the password and yet it is not working. What am I doing wrong?
private string Password; public bool ChangePassword( string oldPassword, string newPassword) { if (oldPassword == Password) {
Authenticator Simon = new Authenticator() ;
bool Done;
Done= Simon.ChangePas sword("", "MyNewPassword" );
I assume Done is returning false. That is because you are comparing an empty length string to a null string, which will return false;
SP
"Roy Gourgi" <ro***@videotro n.ca> wrote in message
news:2C******** ***********@wag ner.videotron.n et... Hi, Yes that is right it is returning false. So how would I do it. I took this example straight out of a book. So much for that. :)
Roy
you can declare Password as private string Password = "";
SP
"SP" <ec***********@ hotmail.com> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. .. "Roy Gourgi" <ro***@videotro n.ca> wrote in message news:nO******** ***********@wag ner.videotron.n et... HI,
Why is this password authentication not working as I am sending? I am trying to change the password and yet it is not working. What am I doing wrong?
private string Password; public bool ChangePassword( string oldPassword, string newPassword) { if (oldPassword == Password) {
Authenticator Simon = new Authenticator() ;
bool Done;
Done= Simon.ChangePas sword("", "MyNewPassword" );
I assume Done is returning false. That is because you are comparing an empty length string to a null string, which will return false;
SP
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tim Daneliuk |
last post by:
OK, I've Googled for this and cannot seem to quite find what I need.
So, I turn to the Gentle Geniuses here for help. Here is what I
need to do from within a script:
Given a username and a password (plain text):
1) Validate that the password is correct for that user *without actually logging in*.
2) If the password is valid, return a list of all the groups the user belongs to.
Otherwise, return some error string.
|
by: John Davis |
last post by:
Anyone knows how to create the username/password authorization dialog in
ASP?
Thanks,
John
|
by: jrefactors |
last post by:
I want to ask how password is stored and how to check the
authentication?
I have heard password is never encrypted and decrypted, but it is
hashed.
For example, consider a simple email logon authentication in a hash
table:
Key: my email address
Value: hash_function(my plan text password)
|
by: Henry |
last post by:
Hi, my asp.net application is accessing a mssql on another server.
This works fine when I use this in my web.config file:
<add key="dbkey" value="server=192.12.12.1;database=mydb;user=dbuser;password=mypassword"
/>
However I don't like to store my password in plain text.
I played around with aspnet_setreg.exe and I followed those
instructions:
|
by: Noel Volin |
last post by:
Anyone who can help here is much appreciated. I am trying to
programmatically log onto a website. I am using the code provided in VS for
the AuthenticationManager Class example (
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemNetAuthenticationManagerClassTopic.htm
). I have also download and tried to use the following CsharpHttp executable
in an attempt to find my problem:...
| |
by: Dmitri Priimak |
last post by:
Hi All.
There is one thing which somewhat annoys me, which is that psql always
prompts me for a password.
That makes it difficult for use in Makefile where I want to say 'make
build_db', which would run psql for
each stored procedure which needs to be updated. Is there a way to
specify that password somehow in a
command line like isql ( sybase cli client ) does?
|
by: J |
last post by:
Hello. I apologize if this isn't the appropriate group for this question
but I was wondering if it's possible to allow regular windows domain users
to change their passwords through an .asp page? I'm trying to figure out
the best way to handle domain users to log into an .asp application tied
with SQL Server 2000 on the back end since I keep reading that windows
authentication is better practice to log into SQL Server. Thanks in...
|
by: Afshar |
last post by:
Hi everybody there,
I have a special Login page that wants users to enter 3 passwords
rather than a single password. But can't do it with Login control. I
tried following scenarios:
1. Put an Login in the page and set its Visible = False instead put my
own username and 3 password on the form. Then I checked 2nd and 3rd
password seperately and passed username and password to Login control
via its Username and Password properties but...
|
by: webrod |
last post by:
Hi all,
how can I check a user/password in a LDAP ?
I don't want to connect with this user, I would like to connect to LDAP
with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and check
the password.
The thing is I can't access the password attribute to compare with the
user's password provided.
|
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= |
last post by:
Hi,
we've got a strange problem here:
We've created an ASP.NET 2.0 web application using Membership.ValidateUser()
to manually authenticate users with our website.
The problem is: If the user has the "User must change password" flag set in
Active Directory, ValidateUser() always returns false if that user wants to
log in.
|
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...
| |
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |