示例#1
0
        static void Main()
        {
            string exe = Application.ExecutablePath;

            System.IO.FileInfo info    = new System.IO.FileInfo(exe);
            string             exeName = info.Name;
            string             logname = exeName + ".log";

            Logger.Initialize(Data.DataFolder.Path, logname,
                              Properties.Settings.Default.log4netCategory);

            string dbPath = Data.SQLite.DataStore.InitializeDatabase();

            long unixTime = UnixTimestamp.UtcNow.UnixTime;

            Logger.Info("Poker Hand History Started: Unix Time {0}", unixTime);

            Core.IIS.IISExpress iisExpress;

            System.IO.DirectoryInfo dirInfo = info.Directory;
            string programDir = dirInfo.FullName;

            string appPath = System.IO.Path.Combine(programDir, "Http");
            int    port    = IISExpressPort;

            bool sysTray = IISExpressSysTray;

            iisExpress = new Core.IIS.IISExpress(appPath, port, sysTray);

            string httpPath       = iisExpress.Path;
            bool   httpPathExists = System.IO.Directory.Exists(httpPath);

            if (httpPathExists)
            {
                if (iisExpress.IsRunning)
                {
                    iisExpress.Stop();
                    System.Threading.Thread.Sleep(TimeSpan.FromSeconds(10));
                }

                iisExpress.Start();

                string url = string.Format("http://localhost:{0}/Home", port);
                NativeMethods.ShellExecute(IntPtr.Zero, "open",
                                           url, "", "", NativeMethods.ShowCommands.SW_SHOW);
            }
            else
            {
                Logger.Warn("Hand Analysis ASP.NET Applicaton not found at {0}", httpPath);
            }
        }
示例#2
0
        static void Main()
        {
            string exe = Application.ExecutablePath;
            System.IO.FileInfo info = new System.IO.FileInfo(exe);
            string exeName = info.Name;
            string logname = exeName + ".log";

            Logger.Initialize(Data.DataFolder.Path, logname,
                Properties.Settings.Default.log4netCategory);

            string dbPath = Data.SQLite.DataStore.InitializeDatabase();

            long unixTime = UnixTimestamp.UtcNow.UnixTime;
            Logger.Info("Poker Hand History Started: Unix Time {0}", unixTime);

            Core.IIS.IISExpress iisExpress;

            System.IO.DirectoryInfo dirInfo = info.Directory;
            string programDir = dirInfo.FullName;

            string appPath = System.IO.Path.Combine(programDir, "Http");
            int port = IISExpressPort;

            bool sysTray = IISExpressSysTray;
            iisExpress = new Core.IIS.IISExpress(appPath, port, sysTray);

            string httpPath = iisExpress.Path;
            bool httpPathExists = System.IO.Directory.Exists(httpPath);

            if (httpPathExists)
            {
                if (iisExpress.IsRunning)
                {
                    iisExpress.Stop();
                    System.Threading.Thread.Sleep(TimeSpan.FromSeconds(10));
                }

                iisExpress.Start();

                string url = string.Format("http://localhost:{0}/Home", port);
                NativeMethods.ShellExecute(IntPtr.Zero, "open",
                    url, "", "", NativeMethods.ShowCommands.SW_SHOW);
            }
            else
            {
                Logger.Warn("Hand Analysis ASP.NET Applicaton not found at {0}", httpPath);
            }
        }