public void LoadSettings() { string s = P2pProxyApp.MySettings.GetSetting("dlna", "udn", Guid.NewGuid().ToString()); serialNumber = s; udn = Guid.Parse(s); var label = P2pProxyApp.MySettings.GetSetting("dlna", "label", "P2pProxy DLNA"); friendlyName = label + " (" + Environment.MachineName + ")"; _maxAge = P2pProxyApp.MySettings.GetSetting("dlna", "max-age", 148); _ssdport = P2pProxyApp.MySettings.GetSetting("dlna", "port", 1900); UpnpSettings = new UpnpSettingManager(P2pProxyApp.MySettings.GetSetting("dlna", "profile", "default")); Filter = ContentFilter.Load(); }
private void FormOption_Load(object sender, EventArgs e) { relogin = false; Text = "Настройки"; tabPageAuth.Text = "Регистрационные данные"; tabPageSystem.Text = "Системные"; labelLogin.Text = "Пользователь"; labelPassword.Text = "Пароль"; labelWebPort.Text = "HTTP-порт"; record_path.Text = "Папка для записей"; lblVlcCache.Text = "Live-кэш (c.)"; lblVlcMux.Text = "Стартовый кэшь"; lblVlcPort.Text = "Порт"; chkExtVlc.Text = "Использовать внешний VLC"; as_timeout.Text = "Таймаут AceStream"; lblVlcRtspPort.Text = "RTSP-порт"; textBoxLogin.Text = P2pProxyApp.MySettings.GetSetting("torrent-tv.ru", "login", "anonymous"); textBoxHttpPort.Text = P2pProxyApp.MySettings.GetSetting("web", "port", 8081).ToString(); string pass = String.Empty; try { pass = CryptoHelper.Decrypt <System.Security.Cryptography.AesCryptoServiceProvider>( P2pProxyApp.MySettings.GetSetting("torrent-tv.ru", "password", "anonymous"), Environment.MachineName, "_Cr[e?g1"); } catch { } if (string.IsNullOrEmpty(pass)) { pass = "******"; P2pProxyApp.MySettings.GetSetting("torrent-tv.ru", "login", "anonymous"); } textBoxPassword.Text = pass; buttonCancel.Text = "Выход"; buttonOK.Text = "Сохранить"; Opened = true; string recpath = P2pProxyApp.MySettings.GetSetting("records", "path", new Uri(P2pProxyApp.ApplicationDataFolder + "/records").LocalPath); textRecordPath.Text = recpath; vlcport = P2pProxyApp.MySettings.GetSetting("vlc", "vlcport", 4212); txtVlcPort.Text = vlcport.ToString(); vlccache = P2pProxyApp.MySettings.GetSetting("vlc", "vlccache", 5000); txtVlcCache.Text = vlccache.ToString(); vlcmuxcache = P2pProxyApp.MySettings.GetSetting("vlc", "vlcmuxcache", 0); txtVlcMux.Text = vlcmuxcache.ToString(); string vlcpath = P2pProxyApp.MySettings.GetSetting("vlc", "vlcpath"); if (string.IsNullOrEmpty(vlcpath)) { chkExtVlc.Checked = false; } else { txtExtVlcPath.Text = vlcpath; chkExtVlc.Checked = P2pProxyApp.MySettings.GetSetting("vlc", "vlcext", false); } txtVlcRtspPort.Text = P2pProxyApp.MySettings.GetSetting("vlc", "rtspport", 5554).ToString(); if (_app != null) { var broadcaster = _app.Broadcaster as VlcBroadcaster; if (broadcaster != null) { comboTranscode.Items.AddRange(broadcaster.GetTranscodes().Select(t => t.Name).ToArray()); } } int astimeout = P2pProxyApp.MySettings.GetSetting("system", "as_timeout", 60); txtAsTimeOut.Text = astimeout.ToString(); txtMaxAge.Text = P2pProxyApp.MySettings.GetSetting("dlna", "max-age", _app.Device.MaxAge.ToString()); txtUpnpPort.Text = P2pProxyApp.MySettings.GetSetting("dlna", "port", "1900"); txtUdn.Text = P2pProxyApp.MySettings.GetSetting("dlna", "udn", Guid.NewGuid().ToString()); BindingSource bsource = new BindingSource(); var profiles = UpnpSettingManager.GetProfiles();; bsource.DataSource = profiles; cbProfile.DataSource = bsource; cbProfile.DisplayMember = "Value"; cbProfile.ValueMember = "Key"; string profile = P2pProxyApp.MySettings.GetSetting("dlna", "profile", "default"); cbProfile.SelectedItem = profiles.ContainsKey(profile) ? profiles.First(p => p.Key == profile) : profiles.First(p => p.Key == "default"); txtLabelDlna.Text = P2pProxyApp.MySettings.GetSetting("dlna", "label", "P2pProxy"); chkAutoUpdate.Checked = P2pProxyApp.MySettings.GetSetting("system", "update", true); chckDlnaEnabled.Checked = P2pProxyApp.MySettings.GetSetting("dlna", "enable", true); chkUseVLC.Checked = P2pProxyApp.MySettings.GetSetting("system", "usevlc", true); }