Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:44:16+00:00 2026-06-14T00:44:16+00:00

Possible Duplicate: incorrectly checks the response c# I have a code: Match match =

  • 0

Possible Duplicate:
incorrectly checks the response c#

I have a code:

Match match = regex.Match(responseFromServer);
if (match.Success)
{
    var input = responseFromServer;
    var split = input.Split(':');
    var final = split[3];
    ProcessStartInfo mcStartInfo = new Shitocode;
    Process.Start(mcStartInfo);
    this.Close();
}
else if (responseFromServer == " Bad Login")
{
    MessageBox.Show("Uncorrect login/password!");
}
else if (responseFromServer == " Old version")
{
    MessageBox.Show("Launcher is old!");
}

Why there is no message box showing in the last two inspections?

I have tried to do things differently:

if (match.Success)
{
    var input = responseFromServer;
    var split = input.Split(':');
    var final = split[3];
    ProcessStartInfo mcStartInfo = new Shitocode;
    Process.Start(mcStartInfo);
    this.Close();
}
else if (responseFromServer.Equals("Bad Login"))
{
    MessageBox.Show("Uncorrect login/password!");
}
else if (responseFromServer.Equals("Old Version"))
{
    MessageBox.Show("Launcher is old!");
}

I enter the wrong password, but does not open the messagebox

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:44:17+00:00Added an answer on June 14, 2026 at 12:44 am

    Probably your responseFromServer does not match the values you are checking (Bad Login, and Old Version).
    Try to add another else at the end of the if sequence and look what you’ve got.

    if (match.Success)
    {
       //your code
    }
    else if (responseFromServer.Equals("Bad Login"))
    {
        MessageBox.Show("Uncorrect login/password!");
    }
    else if (responseFromServer.Equals("Old Version"))
    {
        MessageBox.Show("Launcher is old!");
    }
    else
    {
        MessageBox.Show("Cannot login, unknown response: " + responseFromServer)
    }
    

    EDIT after comment

    If you do not the exact message, but you know that it has to contain some exact string, you could change the two responseFromServer.Equals() to responseFromServer.Contains()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Java Calendar Setting Incorrectly i have this code: GregorianCalendar cal = (GregorianCalendar)
Possible Duplicate: Why does ASP.NET auto-generated .designer code have the incorrect type? On my
Possible Duplicate: Why does getDay return incorrect values? (javascript) I have the following code
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: How do you generate dynamic (parameterized) unit tests in Python? I have
Possible Duplicate: Convert some code from C++ to C I've got some code that
Possible Duplicate: Is JavaScript's Math broken? I have just started playing around with Javascript
Possible Duplicate: Show default value for editing on Python input possible? I'd like to
Possible Duplicate: How to run a database script file from Delphi? I have a
Possible Duplicate: SendInput and 64bits I'm using SendInput from .NET code (PInvoke). code used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.