...

View Full Version : c# he;lp



Chris-2k
03-17-2013, 11:52 PM
Hi

Can somebody see where i'm going wrong:


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:


##############################################################################

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

##############################################################################



thanks

Chris-2k
03-18-2013, 11:30 PM
anyone to help?

wasniewc
03-29-2013, 08:46 PM
try to display your actual error

try {

}

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum