void GetMailUser(string serverId, out string toUser, out string copyUser) { toUser = ""; copyUser = ""; string iniPath = Application.StartupPath + "\\" + "UserMailConfig.ini"; INIHelper ini = new INIHelper(iniPath); string section = "ServerID=" + serverId + ""; toUser = ini.IniReadValue(section, "ToUser"); copyUser = ini.IniReadValue(section, "CoypUser"); }
public MainWindow() { InitializeComponent(); // this.ShowTitleBar = false; this.ShowIconOnTitleBar = true; this.ShowMinButton = true; this.ShowMaxRestoreButton = false; this.ShowCloseButton = true; this.ResizeMode = ResizeMode.CanMinimize; // this.SaveWindowPosition = true; this.LeftWindowCommandsOverlayBehavior = WindowCommandsOverlayBehavior.Never; this.RightWindowCommandsOverlayBehavior = WindowCommandsOverlayBehavior.Never; this.image1.Source = EyeHelper.ChangeBitmapToImageSource(softwatcher.Properties.Resources.drag); // this.Flyouts1.Items.Add(new LoginFlyout()); this.Flyouts1.Items.Add(new SettingsView()); this.Flyouts1.Items.Add(new SetXiaohaoFlyout()); new SoftContext(this); try { this.Topmost = bool.Parse(INIHelper.IniReadValue("BaseConfig", "Topmost", AppDomain.CurrentDomain.BaseDirectory + "\\config.ini")); } catch { } }
public MainViewModel() { this.SettingsCommand = new RelayCommand(() => { Locator.Settings.IsOpen = true; }); this.ExitLoginCommand = new RelayCommand(() => { Locator.Login.IsOpen = true; SoftContext.IsLogin = false; } , () => SoftContext.IsLogin); this.LoadedCommand = new RelayCommand(() => { // WinIo.Initialize(); try { string hotKey = INIHelper.IniReadValue("BaseConfig", "HotKey", AppDomain.CurrentDomain.BaseDirectory + "\\config.ini"); } catch { } }); this.ClosedCommand = new RelayCommand(() => { TeleportViewModel.timer.Stop(); }); }
public TeleportView() { InitializeComponent(); UserActivityHook choosesc = new UserActivityHook(); choosesc.KeyDown += new System.Windows.Forms.KeyEventHandler(MyKeyDown); try { this.cbUseHotKey.IsChecked = bool.Parse(INIHelper.IniReadValue("BaseConfig", "UseHotKey", AppDomain.CurrentDomain.BaseDirectory + "\\config.ini")); } catch { } }
public static string GetValue(string key) { if (string.IsNullOrEmpty(key)) { return("未定义的错误"); } if (!File.Exists(iniPath)) { return("WEB系统配置错误"); } if (mINIHelper == null) { mINIHelper = new INIHelper(iniPath); } return(mINIHelper.IniReadValue(sectionName, key)); }
public SettingsViewModel() { this.Header = "设置"; this.Position = Position.Right; string hotkey = INIHelper.IniReadValue("BaseConfig", "HotKey", AppDomain.CurrentDomain.BaseDirectory + "\\config.ini"); if (string.IsNullOrEmpty(hotkey)) { this.CurrentOption = "1"; } else { this.CurrentOption = hotkey; } this.AccentColors = ThemeManager.Accents .Select(a => new AccentColorMenuData() { Name = a.Name, ColorBrush = a.Resources["AccentColorBrush"] as Brush }) .ToList(); this.AccentColors.Add(new AccentColorMenuData() { Name = "random" }); this.ChangeAccentCommand = new RelayCommand <AccentColorMenuData>((item) => { if (item == null) { return; } this.SetTheme(item.Name); INIHelper.IniWriteValue("BaseConfig", "Accent", item.Name, AppDomain.CurrentDomain.BaseDirectory + "\\config.ini"); }); string accentName = INIHelper.IniReadValue("BaseConfig", "Accent", AppDomain.CurrentDomain.BaseDirectory + "\\config.ini"); this.SetTheme(accentName); this.SelectedItem = this.AccentColors.FirstOrDefault(x => x.Name == accentName); }