private void ShowSupportForums(object obj) { try { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("SystemSettings_ForumsLink")); } catch (Exception e) { LogProvider.Log.Error(this, "Couldn't show support forum", e); } }
private void RenewLicense(object obj) { try { var license = ServiceLocator.Current.GetInstance <ILicenseService>(); var licenseCode = license.LicenseInfos.Where(x => !string.IsNullOrEmpty(x.Serial) && !x.IsTrial).OrderBy(x => x.ExpiryDate).FirstOrDefault()?.Serial ?? string.Empty; Process.Start(BrowserHelper.GetDefaultBrowserPath(), String.Format(CommonResourceManager.Instance.GetResourceString("SystemSettings_RenewLicenseLink"), licenseCode)); } catch (Exception ex) { LogProvider.Log.Error(ex); } }
private void btnEulaUrl_Click(object sender, System.Windows.RoutedEventArgs e) { LicensingManager.InterfaceInteraction.EulaUrlClicked = true; if (!String.IsNullOrEmpty(_clientLicense.ProductUrl)) { try { Process.Start(BrowserHelper.GetDefaultBrowserPath(), _clientLicense.EulaUrl); } catch { } } }
private void OpenHyperLink() { if (IsHyperLinkPresent) { try { Process.Start(BrowserHelper.GetDefaultBrowserPath(), HyperLinkText); } catch (Exception ex) { LogProvider.Log.Error(ex); } } InvokeClose(); }
private void InitializeCommands() { var canSend = this.WhenAny(x => x.Email, x => x.Serial, (x1, x2) => Utils.IsValidEmail(x1.Value) && (state == RegistrationState.Registration && !string.IsNullOrWhiteSpace(Serial) || state != RegistrationState.Registration)); SendCommand = ReactiveCommand.Create(() => Send(), canSend); CancelCommand = ReactiveCommand.Create(() => Cancel()); TrialCommand = ReactiveCommand.Create(() => InitializeTrial()); BackCommand = ReactiveCommand.Create(() => Back()); OKCommand = ReactiveCommand.Create(() => Cancel()); RegisterCommand = ReactiveCommand.Create(() => InitializeRegister(false)); ActivateCommand = ReactiveCommand.Create(() => Register()); BuyCommand = ReactiveCommand.Create(() => { try { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("Common_BuyLink")); } catch (Exception ex) { LogProvider.Log.Error(this, "Could not open buy link", ex); } }); RenewCommand = ReactiveCommand.Create(() => { try { var serialToRenew = licenseService.LicenseInfos .Where(l => !string.IsNullOrEmpty(l.Serial) && !l.IsTrial) .OrderBy(l => l.ExpiryDate).FirstOrDefault()? .Serial; if (!string.IsNullOrWhiteSpace(serialToRenew)) { Process.Start(BrowserHelper.GetDefaultBrowserPath(), string.Format(CommonResourceManager.Instance.GetResourceString("SystemSettings_RenewLicenseLink"), serialToRenew)); } } catch (Exception ex) { LogProvider.Log.Error(this, "Could not open renew link", ex); } }); }
protected virtual void OpenLink(string link) { if (string.IsNullOrWhiteSpace(link)) { return; } var browserPath = BrowserHelper.GetDefaultBrowserPath(); try { Process.Start(browserPath, link); } catch (Exception e) { LogProvider.Log.Error(this, $"Link {link} couldn't be opened", e); } }
public async Task <string> Run() { Log.Info("Initializing Captcha Bypass WebServer..."); if (WebConf == null) { WebConf = new Configuration(); WebConf.Port = 80; WebConf.AllowDirectoryListing = false; WebConf.SourcePaths.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "web")); } if (HttpServer == null) { HttpServer = new HttpServer(WebConf); HttpServer.RequestReceived += (sender, args) => Log.Debug("[{0}] - {1}", args.Request.HttpMethod, args.Request.Path); HttpServer.UnhandledException += (sender, args) => Log.Exception(args.Exception, args.Exception.Source); } if (!SetHostsFile()) { return(null); } try { Log.Info("Starting WebServer..."); HttpServer.Start(); } catch (Exception ex) { Log.Exception(ex, "Failed to start the WebServer. Possible port or permission issue."); try { var lines = File.ReadAllLines(HostsFilePath).ToList(); var nexonLine = lines.FirstOrDefault(l => l.Contains("nexon.com")); if (!string.IsNullOrWhiteSpace(nexonLine)) { lines.Remove(nexonLine); File.WriteAllLines(HostsFilePath, lines); HostFileFailure = false; } lines = File.ReadAllLines(HostsFilePath).ToList(); nexonLine = lines.FirstOrDefault(l => l.Contains("nexon.com")); if (!string.IsNullOrWhiteSpace(nexonLine)) { Log.Error("The sanity check for the HOSTS file failed, falling back!"); HostFileFailure = true; return(null); } } catch (Exception ex2) { // Should never be called as non admin... Log.Exception(ex2, "Failed to read or edit the HOSTS file. {0}", App.IsAdministrator() ? "Running as admin." : "NOT running as admin."); HostFileFailure = true; return(null); } return(null); } string recaptchaToken = null; Completed += s => recaptchaToken = s; Log.Info("Starting the browser..."); RunAsDesktopUser(BrowserHelper.GetDefaultBrowserPath(), "http://nexon.com"); while (recaptchaToken == null) { await Task.Delay(100); } return(recaptchaToken); }
private void InitializeCommands() { var canSend = this.WhenAny(x => x.Email, x => Utils.IsValidEmail(x.Value)); SendCommand = ReactiveCommand.Create(() => Send(), canSend); CancelCommand = ReactiveCommand.Create(() => Cancel()); TrialCommand = ReactiveCommand.Create(() => InitializeTrial()); BackCommand = ReactiveCommand.Create(() => Back()); OKCommand = ReactiveCommand.Create(() => Cancel()); RegisterCommand = ReactiveCommand.Create(() => InitializeRegister(false)); ActivateCommand = ReactiveCommand.Create(() => Register()); BuyCommand = ReactiveCommand.Create(() => { try { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("PKC_BuyLink")); } catch (Exception ex) { LogProvider.Log.Error(CustomModulesNames.PKCatcher, "Could not open buy link", ex); } }); RenewCommand = ReactiveCommand.Create(() => { try { var serialToRenew = licenseService.LicenseInfos .Where(l => !string.IsNullOrEmpty(l.Serial) && !l.IsTrial) .OrderBy(l => l.ExpiryDate).FirstOrDefault()? .Serial; if (!string.IsNullOrWhiteSpace(serialToRenew)) { Process.Start(BrowserHelper.GetDefaultBrowserPath(), string.Format(CommonResourceManager.Instance.GetResourceString("SystemSettings_RenewLicenseLink"), serialToRenew)); } } catch (Exception ex) { LogProvider.Log.Error(CustomModulesNames.PKCatcher, "Could not open renew link", ex); } }); ResetLicensesCommand = ReactiveCommand.Create(() => { try { LogProvider.Log.Info(CustomModulesNames.PKCatcher, "Resetting licenses"); licenseService.ResetLicenses(); LogProvider.Log.Info(CustomModulesNames.PKCatcher, "Licenses has been reset"); InitializeMessage("PKC_RegistrationView_ResetLicensesSuccess"); } catch (Exception ex) { LogProvider.Log.Error(CustomModulesNames.PKCatcher, "Could not reset licenses", ex); InitializeMessage("PKC_RegistrationView_ResetLicensesFailed"); } }); }
private void ShowSupportForums(object obj) { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("SystemSettings_ForumsLink")); }
private void ShowKnowledgeBase(object obj) { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("SystemSettings_KnowledgeBase")); }
private void ShowOnlineManual(object obj) { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("SystemSettings_OnlineManual")); }
private void AddActivation(object obj) { Process.Start(BrowserHelper.GetDefaultBrowserPath(), CommonResourceManager.Instance.GetResourceString("SystemSettings_AddActivationLink")); }