Пример #1
0
        /// <summary>
        /// 從Json導入資料,並且寫入registry
        /// </summary>
        /// <param name="regJSON"></param>
        public void SetSettingsToRegisry(string regJSON)
        {
            FRegSetting r = new FRegSetting();

            r = JsonConvert.DeserializeObject <FRegSetting>(regJSON);

            EMail        = r.EMail;
            Password     = r.Password;
            IMAPServerIP = r.IMAPServerIP;
            SMTPServerIP = r.SMTPServerIP;
            SMTPLogLevel = r.SMTPLogLevel;
            WebServiceIP = r.WebServiceIP;

            DMS_Enable     = r.DMS_Enable;
            DMS_TriggerAt  = r.DMS_TriggerAt;
            DMS_LastUpdate = r.DMS_LastUpdate;
            DMS_Setting    = r.DMS_Setting;

            LogLevel            = r.LogLevel;
            FeatureByte         = r.FeatureByte;
            SMTPLogWriterEnable = r.SMTPLogWriterEnable;

            SetSettingsToRegisry();
        }
Пример #2
0
 public static void AddRight(FConstants.FeatureByte target)
 {
     FConstants.FeatureByte fb = (FConstants.FeatureByte)Convert.ToInt32(FFunc.GetRegKey("FeatureByte"));
     fb = (fb | target); //增加
     FFunc.SetRegKey("FeatureByte", Convert.ToInt32(fb));
 }
Пример #3
0
 public static void DelRight(FConstants.FeatureByte target)
 {
     FConstants.FeatureByte fb = (FConstants.FeatureByte)Convert.ToInt32(FFunc.GetRegKey("FeatureByte"));
     fb = (fb & (FConstants.FeatureByte.ALL ^ target)); //刪除
     FFunc.SetRegKey("FeatureByte", Convert.ToInt32(fb));
 }
Пример #4
0
        public static bool HasRight(FConstants.FeatureByte target)
        {
            FConstants.FeatureByte fb = (FConstants.FeatureByte)Convert.ToInt32(FFunc.GetRegKey("FeatureByte"));

            return((fb & target) == target);
        }
Пример #5
0
 public void delRight(FConstants.FeatureByte target)
 {
     FeatureByte = (FeatureByte & (FConstants.FeatureByte.ALL ^ target)); //刪除
 }
Пример #6
0
 public void addRight(FConstants.FeatureByte target)
 {
     FeatureByte = (FeatureByte | target); //增加
 }
Пример #7
0
 public bool hasRight(FConstants.FeatureByte target)
 {
     return((FeatureByte & target) == target);
 }