Exemplo n.º 1
0
        public void open_ans()
        {
            OpenFileDialog od = new OpenFileDialog();

            od.InitialDirectory = @"\saved";
            od.Filter           = "DexESparkOrient files (*.dx)|*.dx";
            if (od.ShowDialog() == DialogResult.OK)
            {
                fl.set_text(fl.get_text(od.FileName), @"inner_temp\response.dx");
            }
        }
Exemplo n.º 2
0
        private void send_q_Click(object sender, EventArgs e)
        {
            string user    = username.Text;
            string pass    = passwrd.Text;
            string To      = to.Text;
            string Message = message_text.Text;

            File.WriteAllText(@"mail_data\username.edxf", string.Empty);
            File.WriteAllText(@"mail_data\passwrd.edxf", string.Empty);
            File.WriteAllText(@"mail_data\to_mail.edxf", string.Empty);
            File.WriteAllText(@"mail_data\message.edxf", string.Empty);
            File.WriteAllText(@"mail_data\response.dx", string.Empty);



            if (user != "" && pass != "" && Message != "")
            {
                fl.set_text(user, @"mail_data\username.edxf");
                fl.set_text(pass, @"mail_data\passwrd.edxf");
                fl.set_text(To, @"mail_data\to_mail.edxf");
                fl.set_text(Message, @"mail_data\message.edxf");
                process_exec ps = new process_exec(@"Python\python.exe", @"scripts\SendMail.py");
                ps.process();
            }
            else
            {
                MessageBox.Show("Please, fill all the fields", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            string result = fl.get_text(@"mail_data\response.dx");

            if (result == "success")
            {
                MessageBox.Show("Message sent successfully", "Success (:", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (result == "error")
            {
                MessageBox.Show("Something went wrong, Please try again later.", "Sorry x_x", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }