예제 #1
0
 public virtual bool Loading()
 {
     ConfigureManager cfg = new ConfigureManager (this);
     bool isChange = false;
     if (cfg.IsConfigKeyExists ("Address")) {
         this.DatabaseAddr = cfg ["Address"];
     } else {
         cfg ["Address"] = "127.0.0.1";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("Ports")) {
         this.DatabasePorts = cfg ["Ports"];
     } else {
         cfg ["Ports"] = "3306";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("User")) {
         this.DatabaseUser = cfg ["User"];
     } else {
         cfg ["User"] = "******";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("Password")) {
         this.DatabasePassword = cfg ["Password"];
     } else {
         cfg ["Password"] = "******";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("Database")) {
         this.DefaultDatabse = cfg ["Database"];
     } else {
         cfg ["Database"] = "Default";
         isChange = true;
     }
     if (isChange) {
         cfg.SaveAllConfig ();
     }
     return true;
 }
예제 #2
0
파일: PBKDF2.cs 프로젝트: shby0527/Mohachi
 public override bool Loading()
 {
     //the version field is the Plugin GUID
     this.date.VersionHash = this.GetGUID ();
     ConfigureManager cfg = new ConfigureManager (this);
     int min = 100;
     int max = 200;
     if (cfg.IsConfigKeyExists ("MinCount") && cfg.IsConfigKeyExists ("MaxCount")) {
         min = Convert.ToInt32 (cfg ["MinCount"]);
         max = Convert.ToInt32 (cfg ["MaxCount"]);
     } else {
         cfg ["MinCount"] = 100.ToString ();
         cfg ["MaxCount"] = 200.ToString ();
         cfg.SaveAllConfig ();
     }
     this.setOtherArgs (min, max);
     return true;
 }