Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: c# he;lp

  1. #1
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts

    c# he;lp

    Hi

    Can somebody see where i'm going wrong:

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace ImportantChanges
    {
        public partial class Form1 : Form
        {
            public Form1() { InitializeComponent(); }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                try
                {
                    string txt = System.IO.File.ReadAllText(@"./Start/PostInstall.txt");
                    foreach (string line in System.IO.File.ReadAllLines(txt))
                    {
                        string[] txtLine = line.Split(':');
                        if (txtLine[0].ToLower() == "prog name") label3.Text = "Installing " + txtLine[1];
    
                        if (txtLine[0].ToLower() == "installer file")
                            try { System.Diagnostics.Process.Start(txtLine[1]); }
                            catch { MessageBox.Show("Error: File doesn't exist" + txtLine[1]); }
                    }
                    //            try { System.Diagnostics.Process.Start(@"./PostInstall.cmd"); }
                    //            catch { Console.WriteLine("Error: File doesn't exist or is damaged!"); }
                }
                catch { MessageBox.Show("Sorry can't install this program!"); }
            }
        }
    }
    I'm getting that laast message box everytime, Why?

    HERE's the txt file:

    Code:
    ##############################################################################
    
    Install Order: 1
    Prog Name: RocketDock v1.3.5
    Installer File: H:\X17-59183\-=Build Stuff=-\Silent\RocketDock135_Cusom_Silent_Chris2k.exe
    
    ##############################################################################
    thanks

  • #2
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    anyone to help?

  • #3
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try to display your actual error

    try {

    }

    catch (Exception ex) {
    MessageBox.show(ex.message);
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •