Example #1
0
        private static QuiziniereRequest GetQuiziniereRequestByCode(string code)
        {
            QuiziniereRequest output = new QuiziniereRequest();

            output.copie.codeDif      = code;
            output.copie.contenu.date = GetUnixTime();

            return(output);
        }
Example #2
0
        private static bool SendRequest(QuiziniereRequest request)
        {
            string json = JsonConvert.SerializeObject(request);

            try
            {
                requester.UploadString(PUSH_COPIE_ENDPOINT, json);
            } catch { return(false); }

            return(true);
        }
Example #3
0
        static void Main(string[] args)
        {
            InitializeNetworking();

            Console.Write("Exam code : ");

            string code = Console.ReadLine();

            QuiziniereRequest request = GetQuiziniereRequestByCode(code);

            bool success = SendRequest(request);

            if (success)
            {
                Console.WriteLine("Success");
            }
            else
            {
                Console.WriteLine("Error occured, try again later.");
            }

            Console.ReadKey(true);
        }