protected EsamActivity() { mId = InputId; if (string.IsNullOrEmpty(mId) || GetElementById(mId) == null) { throw new Exception("错误的输入框ID"); } mPinLength = PinLength; if (mPinLength <= 0) { mPinLength = 6; } mAllowBlank = AllowBlank; mSectionName = SectionName; if (!int.TryParse(ConfigFile.ReadConfig(mSectionName, "KeyIndex"), out mKeyIndex) || mKeyIndex < 0) { throw new Exception("错误的密钥索引"); } string content = ConfigFile.ReadConfig(mSectionName, "Des"); if (content != "1" && content != "3") { throw new Exception("错误的DES算法"); } if (content == "1") { mKeyLength = 8; } else { mKeyLength = 16; } }
public static void ReadGlobalAppData() { Hashtable hs = ConfigFile.ReadConfig(mSectionName); foreach (DictionaryEntry value in hs) { Activity.globalBundle.PutString(value.Key.ToString(), value.Value.ToString()); } }