/// <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(); }
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)); }
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)); }
public static bool HasRight(FConstants.FeatureByte target) { FConstants.FeatureByte fb = (FConstants.FeatureByte)Convert.ToInt32(FFunc.GetRegKey("FeatureByte")); return((fb & target) == target); }
public void delRight(FConstants.FeatureByte target) { FeatureByte = (FeatureByte & (FConstants.FeatureByte.ALL ^ target)); //刪除 }
public void addRight(FConstants.FeatureByte target) { FeatureByte = (FeatureByte | target); //增加 }
public bool hasRight(FConstants.FeatureByte target) { return((FeatureByte & target) == target); }