private void SunfrogUploader_Load(object sender, EventArgs e) { string filePath = Directory.GetCurrentDirectory() + Settings.Default.SunfrogConfig; if (File.Exists(filePath)) { SunfrogConfig config = SettingUtil.LoadSunfrogInfo <SunfrogConfig>(filePath); if (config != null) { sunfrogConfig = config; tbVpsName.Text = config.SFAcc; tbPass.Text = FileUtil.Decrypt(config.SFPass); numStart.Value = config.StartRange; numEnd.Value = config.EndRange; tbContent.Text = config.Content; tbLogo.Text = config.Logo; } } }
private void ProcessUpload() { try { // load sunfrog config BackendController.Instance.SunfrogConfig = sunfrogConfig; string rootPath = Directory.GetCurrentDirectory(); string logoConfigPath = rootPath + Settings.Default.LogoConfig; string contentConfigPath = rootPath + Settings.Default.ContentConfig; BackendController.Instance.LogoConfig = SettingUtil.LoadSunfrogInfo <LogoConfig>(string.Format(logoConfigPath, sunfrogConfig.Logo)); BackendController.Instance.ContentConfig = SettingUtil.LoadSunfrogInfo <ContentConfig>(string.Format(contentConfigPath, sunfrogConfig.Content)); // load name list BackendController.Instance.LoadNameList(tbNameList.Text.Trim(), chbAutologo.Checked); // update ui lblTotalNames.Invoke(new Action(() => lblTotalNames.Text = BackendController.Instance.NameCount + "")); //step1: login bool result = BackendController.Instance.Step1(); if (result) { lblLogin.Invoke(new Action(() => lblLogin.Text = "Login sucessful!")); } else { lblLogin.Invoke(new Action(() => lblLogin.Text = "Login failed!")); return; } //step2: upload first logo Thread.Sleep(1000); BackendController.Instance.Step2(lbError, progCurrentName, lblCurName, lblNameIndex, false, chbAutologo.Checked, chbSaveDb.Checked, chbFastUpload.Checked); } catch (Exception ex) { logger.ErrorFormat("Mess: {0},\nStacktrace: {1}", ex.Message, ex.StackTrace); } }