/// <summary> /// 初始化Ini配置信息 /// </summary> static void InitIni() { DirTool.Create(R.Paths.Settings); DirTool.Create(R.Paths.Projects); DirTool.Create(R.Paths.DefaultPublishStorage); DirTool.Create(R.Paths.DefaultNewStorage); R.Paths.PublishStorage = IniTool.GetString(R.Files.Settings, "Paths", "PublishStorage", R.Paths.DefaultPublishStorage); if (string.IsNullOrWhiteSpace(R.Paths.PublishStorage)) { R.Paths.PublishStorage = R.Paths.DefaultPublishStorage; } R.Paths.NewStorage = IniTool.GetString(R.Files.Settings, "Paths", "NewStorage", R.Paths.DefaultNewStorage); if (string.IsNullOrWhiteSpace(R.Paths.NewStorage)) { R.Paths.NewStorage = R.Paths.DefaultNewStorage; } R.Tx.IP = IniTool.GetString(R.Files.Settings, "Console", "IP", ""); R.Tx.Port = IniTool.GetInt(R.Files.Settings, "Console", "Port", 0); R.Tx.LocalIP = IniTool.GetString(R.Files.Settings, "Local", "IP", ""); R.Tx.LocalName = IniTool.GetString(R.Files.Settings, "Local", "Name", ""); R.IsAutoDeleteExpiredLog = IniTool.GetBool(R.Files.Settings, "Settings", "AutoDeleteExpiredLog", false); R.AppID = IniTool.GetString(R.Files.Settings, "App", "ID", ""); if (!Str.Ok(R.AppID)) { R.AppID = GuidTool.Short(); IniTool.Set(R.Files.Settings, "App", "ID", R.AppID); } if (!File.Exists(R.Files.NewStorageReadme)) { TxtTool.Create(R.Files.NewStorageReadme, R.NewStorageReadmeTxt); } }
static void InitSettings() { R.Switch.ShowNotifyIcon = IniTool.GetBool(R.Files.Settings, "Switch", "ShowNotifyIcon", true); R.Switch.ShowToast = IniTool.GetBool(R.Files.Settings, "Switch", "ShowToast", true); }