Click here to Skip to main content
15,918,967 members
Home / Discussions / C#
   

C#

 
AnswerRe: client/server problem Pin
Andrei Ungureanu10-Aug-06 2:37
Andrei Ungureanu10-Aug-06 2:37 
GeneralRe: client/server problem Pin
aeliminate10-Aug-06 3:21
aeliminate10-Aug-06 3:21 
GeneralRe: client/server problem Pin
Andrei Ungureanu10-Aug-06 7:31
Andrei Ungureanu10-Aug-06 7:31 
Questionhow to find the word present in the document Pin
ayyp10-Aug-06 2:08
ayyp10-Aug-06 2:08 
AnswerRe: how to find the word present in the document Pin
Not Active10-Aug-06 3:26
mentorNot Active10-Aug-06 3:26 
GeneralRe: how to find the word present in the document Pin
ayyp10-Aug-06 19:07
ayyp10-Aug-06 19:07 
GeneralRe: how to find the word present in the document Pin
Khalid Sabtan3-Jul-12 12:15
Khalid Sabtan3-Jul-12 12:15 
Questiongracefull exit Pin
Glen Harvy10-Aug-06 1:59
Glen Harvy10-Aug-06 1:59 
Hi,
Using V2005;

One of the first methods I run is checking the existance of essential files - particularly in my case the database file. If it doesn't exist I pop up a message box alerting the user and then when they click OK the program should exit ie:

private void startupCheck()<br />
{<br />
  // make sure database file exists<br />
  bool dataBaseExists;<br />
  dataBaseExists = File.Exists(@".\Resources\myclub.mdb");<br />
  if (dataBaseExists == false)<br />
  {<br />
    MessageBox.Show("The database file is missing from the Resource Directory.\nPlease install database file and start program again", "WARNING - CRUCIAL FILE MISSING", MessageBoxButtons.OK, MessageBoxIcon.Stop);<br />
    exitProgram;<br />
  }<br />
}


Problem is that program flow returns to program.cs and then crashes. User is then given the option to debug etc.

How can I get the program to gracefully exit and not leave the user panicing?


Glen Harvy

AnswerRe: gracefull exit Pin
Not Active10-Aug-06 2:52
mentorNot Active10-Aug-06 2:52 
AnswerRe: gracefull exit Pin
Stefan Troschuetz10-Aug-06 2:54
Stefan Troschuetz10-Aug-06 2:54 
GeneralRe: gracefull exit Pin
Glen Harvy10-Aug-06 12:30
Glen Harvy10-Aug-06 12:30 
GeneralRe: gracefull exit Pin
Stefan Troschuetz10-Aug-06 22:16
Stefan Troschuetz10-Aug-06 22:16 
AnswerRe: gracefull exit Pin
Ennis Ray Lynch, Jr.10-Aug-06 4:15
Ennis Ray Lynch, Jr.10-Aug-06 4:15 
GeneralRe: gracefull exit Pin
Glen Harvy10-Aug-06 12:36
Glen Harvy10-Aug-06 12:36 
AnswerRe: gracefull exit Pin
likefood10-Aug-06 9:41
likefood10-Aug-06 9:41 
QuestionSOAP Attachments - c# and java Pin
teluksridhar10-Aug-06 1:18
teluksridhar10-Aug-06 1:18 
QuestionDebugging SP with Sql server 2005. Pin
Ankit_748110-Aug-06 1:12
Ankit_748110-Aug-06 1:12 
QuestionExternal function Pin
thepersonof10-Aug-06 1:06
thepersonof10-Aug-06 1:06 
AnswerRe: External function Pin
Andrei Ungureanu10-Aug-06 2:49
Andrei Ungureanu10-Aug-06 2:49 
GeneralRe: External function Pin
thepersonof10-Aug-06 10:13
thepersonof10-Aug-06 10:13 
QuestionCrystalReportViewer is slow Pin
atuldeore10-Aug-06 0:19
atuldeore10-Aug-06 0:19 
Questionwhat is the formula.... Pin
diddy3410-Aug-06 0:09
diddy3410-Aug-06 0:09 
AnswerRe: what is the formula.... Pin
Guffa10-Aug-06 2:53
Guffa10-Aug-06 2:53 
QuestionChanging display area in ListView Pin
Flow849-Aug-06 23:57
Flow849-Aug-06 23:57 
AnswerRe: Changing display area in ListView Pin
VSush10-Aug-06 0:40
VSush10-Aug-06 0:40 

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.