Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with Access database connectivity in C#.Net Pin
Verghese22-May-08 9:01
Verghese22-May-08 9:01 
AnswerRe: Problem with Access database connectivity in C#.Net Pin
Sujith C Jose22-May-08 8:05
Sujith C Jose22-May-08 8:05 
GeneralRe: Problem with Access database connectivity in C#.Net Pin
Verghese22-May-08 8:58
Verghese22-May-08 8:58 
QuestionWhat does Application.SetCompatibleTextRenderingDefault (bool) do? Pin
Jordanwb22-May-08 6:11
Jordanwb22-May-08 6:11 
AnswerRe: What does Application.SetCompatibleTextRenderingDefault (bool) do? Pin
Judah Gabriel Himango22-May-08 6:30
sponsorJudah Gabriel Himango22-May-08 6:30 
GeneralRe: What does Application.SetCompatibleTextRenderingDefault (bool) do? Pin
Jordanwb22-May-08 9:34
Jordanwb22-May-08 9:34 
GeneralRe: What does Application.SetCompatibleTextRenderingDefault (bool) do? Pin
Judah Gabriel Himango23-May-08 4:46
sponsorJudah Gabriel Himango23-May-08 4:46 
Questioncomparing 2 strings Pin
Jerry Graham22-May-08 5:37
Jerry Graham22-May-08 5:37 
I am reading data from a datafile and comparing it to a literal string. What is puzzling is that no matter what data I read from the data file for the variable "username", the boolean expression

(username == "lexsystem")

evaluates to "true", as if every string matches.

I tried "==", and ".Equals", and "Compare" and all give the same result.

Help!

Here is my code
--------------------------------------------------------------------------
private void btnSubmit_Click(object sender, EventArgs e)
{
FileStream file = new FileStream("LexPassword.txt", FileMode.Open, FileAccess.Read);
StreamReader reader = new StreamReader(file);
string username = reader.ReadLine();
string password = reader.ReadLine();
MessageBox.Show(username);
//MessageBox.Show(password);
//MessageBox.Show(Convert.ToString(txtUsername));
//MessageBox.Show(Convert.ToString(txtPassword));

if (username == "lexsystem")

{
Hide();
LexSystemfrm Form1 = new LexSystemfrm();
Form1.ShowDialog();
Close();
}

else
MessageBox.Show("Invalid Login, Please Enter the Correct Information");
----------------------------------------------------------------------
AnswerRe: comparing 2 strings Pin
Gareth H22-May-08 6:09
Gareth H22-May-08 6:09 
Questionlistview problem Pin
angels77722-May-08 5:11
angels77722-May-08 5:11 
AnswerRe: listview problem Pin
Judah Gabriel Himango22-May-08 5:34
sponsorJudah Gabriel Himango22-May-08 5:34 
QuestionI can't seem to find the BitArray equivalent to Array.ConstrainedCopy() Pin
Zig15822-May-08 4:41
Zig15822-May-08 4:41 
AnswerRe: I can't seem to find the BitArray equivalent to Array.ConstrainedCopy() Pin
Judah Gabriel Himango22-May-08 6:26
sponsorJudah Gabriel Himango22-May-08 6:26 
AnswerRe: I can't seem to find the BitArray equivalent to Array.ConstrainedCopy() Pin
Peter Josefsson Sweden22-May-08 9:34
Peter Josefsson Sweden22-May-08 9:34 
GeneralRe: I can't seem to find the BitArray equivalent to Array.ConstrainedCopy() Pin
Zig15822-May-08 13:43
Zig15822-May-08 13:43 
QuestionMulti Language Support for C# application Pin
Prashant C22-May-08 3:57
Prashant C22-May-08 3:57 
AnswerRe: Multi Language Support for C# application Pin
Simon P Stevens22-May-08 5:05
Simon P Stevens22-May-08 5:05 
QuestionUsing both .NET caching and generic list. Pin
Steve Holdorf22-May-08 3:00
Steve Holdorf22-May-08 3:00 
AnswerRe: Using both .NET caching and generic list. Pin
J4amieC22-May-08 3:20
J4amieC22-May-08 3:20 
GeneralRe: Using both .NET caching and generic list. Pin
Steve Holdorf22-May-08 3:50
Steve Holdorf22-May-08 3:50 
GeneralRe: Using both .NET caching and generic list. Pin
Guffa22-May-08 4:06
Guffa22-May-08 4:06 
QuestionRe: Using both .NET caching and generic list. Pin
Steve Holdorf22-May-08 4:25
Steve Holdorf22-May-08 4:25 
AnswerRe: Using both .NET caching and generic list. Pin
led mike22-May-08 4:45
led mike22-May-08 4:45 
GeneralRe: Using both .NET caching and generic list. Pin
Steve Holdorf22-May-08 5:01
Steve Holdorf22-May-08 5:01 
GeneralRe: Using both .NET caching and generic list. Pin
Steve Holdorf22-May-08 5:08
Steve Holdorf22-May-08 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.