コード例 #1
0
ファイル: Settings.cs プロジェクト: modernist/CrawlWave
 /// <summary>
 /// The constructor is private so that only the class itself can create an instance.
 /// </summary>
 private Settings()
 {
     settings = new SCSettings();
     settings.SQLServer = ".";
     settings.SQLLogin = "******";
     settings.SQLPass = String.Empty;
     settings.DataFilesPath = String.Empty;
     settings.MaxDBSize = 0;
     LoadSettings();
 }
コード例 #2
0
ファイル: Settings.cs プロジェクト: tmzani/CrawlWave
 /// <summary>
 /// The constructor is private so that only the class itself can create an instance.
 /// </summary>
 private Settings()
 {
     settings               = new SCSettings();
     settings.SQLServer     = ".";
     settings.SQLLogin      = "******";
     settings.SQLPass       = String.Empty;
     settings.DataFilesPath = String.Empty;
     settings.MaxDBSize     = 0;
     LoadSettings();
 }
コード例 #3
0
ファイル: Settings.cs プロジェクト: tmzani/CrawlWave
        /// <summary>
        /// Loads the settings of the plugin from the configuration file.
        /// </summary>
        internal void LoadSettings()
        {
            string configFile = GetPath() + "CrawlWave.ServerCommon.Config.xml";

            try
            {
                if (!File.Exists(configFile))
                {
                    //perhaps the file does not exist - probably because it has not been
                    //created yet. In this case just let the class retain default values.
                    return;
                }
                Stream        ReadStream = File.Open(configFile, FileMode.Open);
                XmlSerializer serializer = new XmlSerializer(typeof(SCSettings));
                settings = (SCSettings)serializer.Deserialize(ReadStream);
                ReadStream.Close();
            }
            catch
            {}
        }
コード例 #4
0
ファイル: Settings.cs プロジェクト: modernist/CrawlWave
 /// <summary>
 /// Loads the settings of the plugin from the configuration file.
 /// </summary>
 internal void LoadSettings()
 {
     string configFile = GetPath()+"CrawlWave.ServerCommon.Config.xml";
     try
     {
         if(!File.Exists(configFile))
         {
             //perhaps the file does not exist - probably because it has not been
             //created yet. In this case just let the class retain default values.
             return;
         }
         Stream ReadStream=File.Open(configFile, FileMode.Open);
         XmlSerializer serializer=new XmlSerializer(typeof(SCSettings));
         settings=(SCSettings)serializer.Deserialize(ReadStream);
         ReadStream.Close();
     }
     catch
     {}
 }