+1(514) 937-9445 or Toll-free (Canada & US) +1 (888) 947-9445

Email timing for test invite ??

Discussion in 'Citizenship' started by Chai_to_Double-double, Feb 12, 2018.

  1. You crack me up!!!
     
  2. For those who know C#, here is a script:

    using System;
    using System.IO;
    using System.Net;
    using System.Net.Http;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;


    namespace ECAS
    {
    class Program
    {
    static Regex RegexHistory = new Regex("\"viewcasehistory\\.do\\?.+\"");
    static Regex RegexStatus = new Regex("<li .+?>(.+)<\\/li>");
    static async Task Run(string UCI, string Name, string DOB, string COB)
    {
    var client = new HttpClient();
    client.BaseAddress = new Uri("https://services3.cic.gc.ca/");
    client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0");
    client.DefaultRequestHeaders.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
    client.DefaultRequestHeaders.Add("Referer", "https://services3.cic.gc.ca/ecas/security.do");
    await client.GetStringAsync("/ecas/security.do?lang=en");
    await client.PostAsync("/ecas/security.do", new StringContent("lang=&app=&securityInd=agree&_target1=Continue", Encoding.UTF8, "application/x-www-form-urlencoded"));
    var status = await client.PostAsync("/ecas/authenticate.do", new StringContent("lang=&_page=_target0&app=&identifierType=1&identifier=" + UCI + "&surname=" + Name + "&dateOfBirth=" + DOB + "&countryOfBirth=" + COB + "&_submit=Continue", Encoding.UTF8, "application/x-www-form-urlencoded"));
    foreach (Match match in RegexHistory.Matches(await status.Content.ReadAsStringAsync()))
    {
    var path = "/ecas/" + WebUtility.HtmlDecode(match.Value.Trim('\"'));
    var data = await client.GetStringAsync(path);

    data = data.Substring(data.IndexOf("<form"));
    data = data.Substring(0, data.IndexOf("</form>"));
    data = data.Substring(data.IndexOf("<ol>") + "<ol>".Length);
    data = data.Substring(0, data.IndexOf("</ol>"));
    data = data.Trim();
    foreach (Match m in RegexStatus.Matches(data))
    {
    Console.WriteLine(m.Groups[1]);
    Console.WriteLine();
    }
    }
    }
    static void Main(string[] args)
    {
    var Config = Path.ChangeExtension(System.Reflection.Assembly.GetEntryAssembly().Location, "ini");
    if (!File.Exists(Config))
    {
    using (var file = new StreamWriter(Config))
    {
    Console.Write("UCI: ");
    file.WriteLine(Console.ReadLine());
    Console.Write("Surname: ");
    file.WriteLine(Console.ReadLine());
    Console.Write("Date of birth (YYYY-MM-DD): ");
    file.WriteLine(Console.ReadLine());
    Console.Write("Country of birth (code): ");
    file.WriteLine(Console.ReadLine());
    }
    }
    using (var file = new StreamReader(Config))
    {
    Run(file.ReadLine(), file.ReadLine(), file.ReadLine(), file.ReadLine()).Wait();
    }
    Console.Write("Press any key to continue . . .");
    Console.ReadKey();
    }
    }
    }
     
    razerblade likes this.
  3. Nice! Haven't used Csharp, but know a lot of other languages and can make sense of most of it.
     
  4. Yes you are right. I have noticed that but wasn't sure. Thx
     
  5. oh boy, that escalated quickly !!
     
  6. There's as much good information here as in any other that tries to predict the future! o_O
     

Share This Page