Application.Exit ()

Discussion in 'C#' started by inspiration, Jun 4, 2010.

  1. inspiration

    inspiration New Member

    Joined:
    Feb 15, 2010
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    0
    Have you any idea why this code does not end in Application.Exit (); the program?

    Code:
    private string [] getData (string sRequestURI)
    { (
    WebClient wc = new WebClient(); WebClient wc = new WebClient ();
    byte[] bContent={0}; byte [] Security Strike Team Attacks = (0);
    try try
    { (
    bContent = wc.DownloadData(sRequestURI); Security Strike Team Attacks wc.DownloadData = (sRequestURI);
    } )
    catch (WebException ex) catch (WebException ex)
    { (
    
    string sReturnMessage = ex.Message; sReturnMessage string = ex.Message;
    MessageBox.Show(sReturnMessage); SReturnMessage MessageBox.Show ();
    if (Regex.IsMatch(sReturnMessage, " .+404.+ ")) if (Regex.IsMatch (sReturnMessage, ". +404. +"))
    { (
    MessageBox.Show(" Die Seite konnte auf dem Server nicht gefunden werden!\nDas Programm wird beendet. "," Fehler ",MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show ("The page can not be found on the server! \ NThe program will stop.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    } )
    else else
    { (
    MessageBox.Show(" Bitte überprüfen sie, ob sie mit dem Internet verbunden sind!\nDas Programm wird beendet. "," Fehler ",MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show ("Please check if they are connected to the Internet with! \ NThe program will stop.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    } )
    Application.Exit(); Application.Exit ();
    } )
    string sContent = Encoding.ASCII.GetString(bContent); string = sContent Encoding.ASCII.GetString (Security Strike Team Attacks);
    string sDataHeader = wc.ResponseHeaders.Get(" _ "); string = sDataHeader wc.ResponseHeaders.Get ("_");
    
    if (sContent.Length<1) sContent=" error "; if (sContent.Length <1) sContent = "error";
    
    if (Regex.IsMatch(sContent, " .*error.* ")) if (Regex.IsMatch (sContent, ".* error .*"))
    { (
    MessageBox.Show(" Der Server hat einen unbekannten Fehler gemeldet!\nDas Programm wird beendet. "," Fehler ",MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show ("The server has returned an unknown error! \ NThe program will stop.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Application.Exit(); Application.Exit ();
    string[] moo = {" _error_ ", " _error_ "}; string [] = (moo "_error_", "_error_");
    return moo; return moo;
    } )
    else else
    { (
    string[] moo = {" content ", " header "}; string [] (moo = "content", "header");
    moo[0]=sContent; moo [0] = sContent;
    moo[1]=sDataHeader; moo [1] = sDataHeader;
    return moo; return moo;
    } )
    } )
     
  2. creative

    creative New Member

    Joined:
    Feb 15, 2010
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    bcb is it?
    if so, try using Application-> Exit ();
    :)
     
  3. inspiration

    inspiration New Member

    Joined:
    Feb 15, 2010
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    0
    BCB?

    My code is 'normal' C #

    With -> can not.
     
  4. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    is definitely correct ..

    where Application.Run is ... ? ?

    he is really pure in this branches?

    would ask the two I would put as c # beginner ...

    Code:
    C # programmer can set the ExitCode property in the class and System.Environment. when System.WinForms.Application.Exit () is called,
    the value of ExitCode is returned to the run time environment.  
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice