Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to read End of Line in C# Pin
#realJSOP4-Nov-08 2:22
mve#realJSOP4-Nov-08 2:22 
GeneralRe: How to read End of Line in C# Pin
Ashfield4-Nov-08 2:42
Ashfield4-Nov-08 2:42 
GeneralRe: How to read End of Line in C# Pin
CPallini4-Nov-08 9:37
mveCPallini4-Nov-08 9:37 
QuestionComparing excel data to XML Pin
ndroo8824-Nov-08 0:55
ndroo8824-Nov-08 0:55 
AnswerRe: Comparing excel data to XML Pin
Mircea Puiu4-Nov-08 1:03
Mircea Puiu4-Nov-08 1:03 
GeneralRe: Comparing excel data to XML Pin
ndroo8824-Nov-08 3:09
ndroo8824-Nov-08 3:09 
GeneralRe: Comparing excel data to XML Pin
Mircea Puiu4-Nov-08 4:26
Mircea Puiu4-Nov-08 4:26 
QuestionExiting Windows Application (from the main form constructor) Pin
Dirso4-Nov-08 0:46
Dirso4-Nov-08 0:46 
Hi,

I have a Windows based application and I'd like to make some validations before running (like license or something)
My question is if I do those validations inside the application main form and it's not successfuly done, I'd like to quit, I'd would prefer a friendly "Not Registered Application" message and then close it than throwing an exception.

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FrmGuardian());
        }
    }

/// the main form constructor....
        public FrmGuardian()
        {
            if (!validInstall())
                this.Close(); // here I tried Application.Exit and Application.ExitThread

            using (FrmSplash splash = new FrmSplash())
            {
                splash.Show();
                InitializeComponent();
                splash.Close();
            }
        }

In the current code I get
Cannot access a disposed object.
Object name: 'FrmGuardian'.


Thanks,
Dirso
AnswerRe: Exiting Windows Application (from the main form constructor) Pin
DanB19834-Nov-08 0:50
DanB19834-Nov-08 0:50 
AnswerRe: Exiting Windows Application (from the main form constructor) Pin
User 66584-Nov-08 0:53
User 66584-Nov-08 0:53 
AnswerRe: Exiting Windows Application (from the main form constructor) Pin
Nicholas Butler4-Nov-08 0:54
sitebuilderNicholas Butler4-Nov-08 0:54 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
Dirso4-Nov-08 1:19
Dirso4-Nov-08 1:19 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
Nicholas Butler4-Nov-08 1:57
sitebuilderNicholas Butler4-Nov-08 1:57 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
Dirso4-Nov-08 3:05
Dirso4-Nov-08 3:05 
AnswerRe: Exiting Windows Application (from the main form constructor) Pin
J a a n s4-Nov-08 0:54
professionalJ a a n s4-Nov-08 0:54 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
Dirso4-Nov-08 1:24
Dirso4-Nov-08 1:24 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
User 66584-Nov-08 1:32
User 66584-Nov-08 1:32 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
Dirso4-Nov-08 1:43
Dirso4-Nov-08 1:43 
GeneralRe: Exiting Windows Application (from the main form constructor) Pin
User 66584-Nov-08 3:51
User 66584-Nov-08 3:51 
AnswerRe: Exiting Windows Application (from the main form constructor) Pin
#realJSOP4-Nov-08 1:36
mve#realJSOP4-Nov-08 1:36 
Questionwindows disappearing issue Pin
Calin Dragan4-Nov-08 0:46
Calin Dragan4-Nov-08 0:46 
AnswerRe: windows disappearing issue Pin
Mircea Puiu4-Nov-08 1:24
Mircea Puiu4-Nov-08 1:24 
GeneralRe: windows disappearing issue Pin
Calin Dragan4-Nov-08 1:30
Calin Dragan4-Nov-08 1:30 
QuestionDetect screen content change Pin
DanB19834-Nov-08 0:45
DanB19834-Nov-08 0:45 
AnswerRe: Detect screen content change Pin
Giorgi Dalakishvili4-Nov-08 1:05
mentorGiorgi Dalakishvili4-Nov-08 1:05 

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.