1using System;2using System.Collections.Generic;3using System.Linq;4using System.Windows.Forms;5using MySql.Data.MySqlClient;6using System.Diagnostics;7using System.Windows.Forms.VisualStyles;89namespace IntelliDispatch10{11static class Program12{13/// <summary>14/// The main entry point for the application.15/// </summary>16[STAThread]17static void Main()18{19Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);2021Application.EnableVisualStyles();22Application.SetCompatibleTextRenderingDefault(false);23Application.VisualStyleState = VisualStyleState.NonClientAreaEnabled;2425//Application.VisualStyleState = VisualStyleState.ClientAndNonClientAreasEnabled;2627string MyConString = IntelliDispatch.Global.MyConString;2829MySqlConnection connection = new MySqlConnection(MyConString);30MySqlCommand command = connection.CreateCommand();31connection.Open();32MySqlDataReader Reader;3334command.CommandText = "SELECT * FROM appinfo";35Reader = command.ExecuteReader();3637bool current = true;3839while (Reader.Read())40{41if ((string)Reader["appversion"] == "1.0c")42{43current = true;44}45else46{47current = false;4849}50}5152if (current == false)53{54DialogResult dialogResult = MessageBox.Show("IntelliDispatch is outdated. Would you like to update?", "Update Available!", MessageBoxButtons.YesNo);55if (dialogResult == DialogResult.Yes)56{57Process.Start("http://www.intellidispatch.com/download");58}59else if (dialogResult == DialogResult.No)60{61}62}6364connection.Close();656667Login objLogin = new Login();68if (objLogin.ShowDialog() == DialogResult.OK)69{70Application.Run(new frmMain());71}72else73{7475}76}7778}79}