示例#1
0
        static void Main(string[] args)
        {
            // Входни параметри
            bool bAutoRun = false;

            foreach (string arg in args)
            {
                if (arg == "-autorun")
                {
                    bAutoRun = true;
                }
            }
            //
            string sApplPath         = Path.GetDirectoryName(Application.ExecutablePath);
            string sConnectionString = string.Format("Version=3,uri=file:{0}"
                                                     , Path.Combine(sApplPath, "nadb.db3"));

            // Автоматично стартиране
            if (bAutoRun)
            {
                try
                {
                    using (TextWriter trLogFile = File.AppendText(Path.Combine(sApplPath, "RSSFeeds.log")))
                    {
                        try
                        {
                            AutoRun_RSSFeeds(trLogFile, sApplPath, sConnectionString);
                        }
                        catch (Exception ex)
                        {
                            trLogFile.WriteLine(ex.Message);
                        }
                    }
                }
                catch
                { }
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                frmRss fRss = new frmRss();
                fRss.ApplPath         = sApplPath;
                fRss.ConnectionString = sConnectionString;
                Application.Run(fRss);
            }
        }
示例#2
0
 static void Main(string[] args)
 {
     // Входни параметри
     bool bAutoRun = false;
     foreach( string arg in args)
     {
         if (arg == "-autorun")
         { bAutoRun = true; }
     }
     //
     string sApplPath = Path.GetDirectoryName(Application.ExecutablePath);
     string sConnectionString = string.Format( "Version=3,uri=file:{0}"
                                             , Path.Combine(sApplPath, "nadb.db3"));
     // Автоматично стартиране
     if (bAutoRun)
     {
         try
         {
             using (TextWriter trLogFile = File.AppendText(Path.Combine(sApplPath, "RSSFeeds.log")))
             {
                 try
                 {
                     AutoRun_RSSFeeds(trLogFile, sApplPath, sConnectionString);
                 }
                 catch (Exception ex)
                 {
                     trLogFile.WriteLine(ex.Message);
                 }
             }
         }
         catch
         { }
     }
     else
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         frmRss fRss = new frmRss();
         fRss.ApplPath = sApplPath;
         fRss.ConnectionString = sConnectionString;
         Application.Run(fRss);
     }
 }