public bool DivertNumber(string mobile) { log.LogStart(); System.Net.ServicePointManager.ServerCertificateValidationCallback += SERV.Utils.Authentication.AcceptAllCertificates; string num = mobile.Replace(" ", ""); string servNow = System.Configuration.ConfigurationManager.AppSettings["FlextelNumber"]; string pin = System.Configuration.ConfigurationManager.AppSettings["FlextelPin"]; string format = System.Configuration.ConfigurationManager.AppSettings["FlextelFormat"]; try { log.Info("Diverting flextel to " + num); string res = new System.Net.WebClient().DownloadString(string.Format(format, servNow, pin, num)); log.Info(res); res = res.Trim(); if (res.Contains(",")) { return(res.Split(',')[0].Replace(" ", "") == num); } return(false); } catch { return(false); } }
static void Main(string[] args) { bool running = true; while (running) { int invalid, valid; string[] inputList; invalid = 0; valid = 0; Console.Write("Patient ID(s):"); string input = Console.ReadLine(); if (input == "url") { input = new System.Net.WebClient().DownloadString("https://s3.amazonaws.com/cognisant-interview-resources/identifiers.json"); input = input.Trim('[', ']'); input = input.Replace("\"", string.Empty); inputList = input.Split(","); } else if (input == "exit") { running = false; break; } else { inputList = new string[] { input }; } foreach (string id in inputList) { if (VerifyID(id)) { valid++; } else { invalid++; } } Console.WriteLine("Valid Results [" + valid + "]"); Console.WriteLine("Inavlid Results [" + invalid + "]"); Console.WriteLine("Total IDs: [" + (valid + invalid) + "]\n"); Console.WriteLine("Press any key to input another ID(s)"); Console.ReadKey(); Console.Clear(); } }
/// <summary> /// Checks for launcher and file updates /// </summary> private void CheckForUpdates() { //Check to see if we are bypassing if (BypassDownload) { //We are, bypass downloading UpdateComplete(); return; } UpdateStatusMsg("Checking for launcher updates..."); AssetDownloadController.CurrentDirectory = currentDirectory; AssetDownloadController.SetForm(this); try { string version = GameSettings.Launcher._version; string versionUrl = new System.Net.WebClient().DownloadString(GameSettings.Launcher._versionURL); if (!string.IsNullOrWhiteSpace(versionUrl.Trim()) && !version.Equals(versionUrl.Trim(), StringComparison.Ordinal)) { //Strings dont match, check for greater than by parsing into int if (VersionCheck(version, versionUrl)) { UpdateStatusMsg("No launcher files to update. Skipping..."); } else { AssetDownloadController.OnUpdateLauncher += UpdateLauncher; AssetDownloadController.DownloadAssets(GameSettings.Launcher._launcherAssets, GameSettings.Launcher._launcherAssetList); return; } } else { UpdateStatusMsg("No launcher files to update. Skipping..."); } } catch { UpdateStatusMsg("Cannot download launcher updates....Skipping."); } UpdateFiles(); }
private static bool DivertSingleNumber(string num, string format, string servNow, string pin) { try { log.Info("Diverting flextel to " + num); string res = new System.Net.WebClient().DownloadString(string.Format(format, servNow, pin, num)); log.Info(res); res = res.Trim(); if (res.Contains(",")) { return(res.Split(',')[0].Replace(" ", "") == num); } return(false); } catch { return(false); } }
public LicenseResult VerifyLicense() { Random rnd = new Random(); Assembly assembly = Assembly.GetExecutingAssembly(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); LicenseResult licenseResult = new LicenseResult(); if (_user.Length < 3 || _pass.Length < 3) { licenseResult.Valid = false; licenseResult.Error = "ERR101"; } int randInt = rnd.Next(124, 18724); string randIntHash = GetMd5Hash("S!k@l" + (randInt + 1563).ToString(CultureInfo.InvariantCulture)); string htmlResult = new System.Net.WebClient().DownloadString("http://www.chocobotxiv.com/forum/licensing/action.php?user="******"&pass="******"&action=1&session=" + randInt + "&version=" + fvi.FileMajorPart + "." + fvi.FileMinorPart); bool result = htmlResult == randIntHash; if (result) { //IniParser ini = new IniParser(@"chocobot.ini"); IniParserLegacy.IniFile ini = new IniParserLegacy.IniFile(System.Windows.Forms.Application.StartupPath + "\\chocobot.ini"); ini.IniWriteValue("Credentials", "UserName", _user); ini.IniWriteValue("Credentials", "Password", _pass); //ini.SaveSettings(); } else { licenseResult.Error = htmlResult.Trim(); } licenseResult.Valid = result; return(licenseResult); }
public LicenseResult VerifyLicense() { Random rnd = new Random(); Assembly assembly = Assembly.GetExecutingAssembly(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); LicenseResult licenseResult = new LicenseResult(); if (_user.Length < 3 || _pass.Length < 3) { licenseResult.Valid = false; licenseResult.Error = "ERR101"; } int randInt = rnd.Next(124, 18724); string randIntHash = GetMd5Hash("S!k@l" + (randInt + 1563).ToString(CultureInfo.InvariantCulture)); string htmlResult = new System.Net.WebClient().DownloadString("http://www.chocobotxiv.com/forum/licensing/action.php?user="******"&pass="******"&action=1&session=" + randInt + "&version=" + fvi.FileMajorPart + "." + fvi.FileMinorPart); bool result = htmlResult == randIntHash; if(result) { //IniParser ini = new IniParser(@"chocobot.ini"); IniParserLegacy.IniFile ini = new IniParserLegacy.IniFile(System.Windows.Forms.Application.StartupPath + "\\chocobot.ini"); ini.IniWriteValue("Credentials", "UserName", _user); ini.IniWriteValue("Credentials", "Password", _pass); //ini.SaveSettings(); } else { licenseResult.Error = htmlResult.Trim(); } licenseResult.Valid = result; return licenseResult; }
private void sendIp() { string externalip = new System.Net.WebClient().DownloadString("http://ipinfo.io/ip").Replace(" ", ""); send("I" + externalip.Trim()); }