403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/software/Services/PenpalPush/SplitterSingle/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/software/Services/PenpalPush/SplitterSingle/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.Text.RegularExpressions;
using System.Net;
using System.Text;

namespace SplitterSingle
{
    public partial class Form1 : Form
    {
        int cnt1 = 0;
        int cnt10 = 4;
        private MySqlConnection connection;
        private string server;
        private string database;
        private string uid;
        private string password;
        private string query;
        private string serialno;
        private string messtype;
        private string phonenumber;
        private string mymessage;
        private string senderid;
        private string username;
        private string transid;
        private string billcode;
        private string domain;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        //addevent logs

        public void AddEvent(String Details)
        {

            String[] Lines;
            int i;
            if (cnt1 > 50)
            {
                txtLog.Text = "";
                cnt1 = 0;
            }
            //txtLog.AppendText(Prefix +  + "\r\n");


            if (Details != "")
            {
                Lines = Details.Split('\r');
                for (i = 0; i < Lines.Length; i++)
                    txtLog.AppendText("       " + Lines[i] + "\r\n");
            }
            cnt1++;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;
            String mURL = "";

            request.KeepAlive = true;
            request.Method = "POST";
            request.ContentType = "application/json; charset=utf-8";

            request.Headers.Add("authorization", "Basic ZGY2MGIyNWUtOTJkMy00MDBlLWI5NDctYWVlZTU5M2NmNzA1");

            label3.Text = DateTime.Now.ToString("yyyy/MM/d HH:mm:ss");
            // AddEvent("Nosa Osahon is here, what about you");
            //Database connection
            long serial ;
            server = "localhost";
            database = "smartsmsrouter";
            uid = "smsEngine";
            password = "guEnaR28T";
            string connectionString;
            string nickname ="";
            string country="";
            string messout ="";
            String palid = "";
            String age = "";
            String sex = "";
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            MySqlConnection connection = new MySqlConnection(connectionString);

            using (connection)
            {
                MySqlCommand command = new MySqlCommand(
                  "SELECT sn,nickname,country,age,sex FROM penpalsubscriber where push = '1'  and nickname != '' order by sn ;",
                  connection);
                connection.Open();

                MySqlDataReader reader = command.ExecuteReader();

                if (reader.HasRows)
                {
                   // cnt10 = 3;
                    while (reader.Read())
                    {
                        serial = reader.GetInt64(0);
                        nickname = reader.GetString(1);
                        country = reader.GetString(2);
                      //  palid = reader.GetString(3);
                        age = reader.GetString(3);
                        sex = reader.GetString(4);

                        messout = nickname + " "+ sex + " " + age + " " + country + ". New User. Chat with " + nickname;

                      //  mURL = "http://www.penpalafrica.com/penpal/assets/img/subscribers/" + palid + "/gallery/" + palid + ".jpg";
                        byte[] byteArray = Encoding.UTF8.GetBytes("{"
                                                                + "\"app_id\": \"3ddfb68d-b5e8-4630-90ea-494229489c52\","
                                                                + "\"contents\": {\"en\": \""+messout+"\"},"
                                                                + "\"headings\": {\"en\": \"PenpalAfrica\"},"
                                                                + "\"data\": {\"foo\": \"bar\"},"
                                                            // + "\"include_player_ids\": [\"41ecf0fb-e763-4436-9cd1-24a79b4eea92\"]}");
                                                               + "\"included_segments\": [\"All\"]}");

                        string responseContent = null;

                        try
                        {
                            using (var writer = request.GetRequestStream())
                            {
                                writer.Write(byteArray, 0, byteArray.Length);
                            }

                            using (var response = request.GetResponse() as HttpWebResponse)
                            {
                                using (var reader2 = new StreamReader(response.GetResponseStream()))
                                {
                                    responseContent = reader2.ReadToEnd();
                                }
                            }
                        }
                        catch (WebException ex)
                        {
                            System.Diagnostics.Debug.WriteLine(ex.Message);
                            System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
                        }

                        System.Diagnostics.Debug.WriteLine(responseContent);





                        query = "update penpalsubscriber set push ='2'   where sn ="+serial;
                        UpdateQuery(query);

                        //messout = nickname + " " + country + " " + messout;
                        AddEvent(messout);

                    }
                    //update messagesentsingle

                }
            }

            //timer1 ends here
        }




                private void timer2_Tick(object sender, EventArgs e)
                {
                    var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;
                    String mURL = "";

                    request.KeepAlive = true;
                    request.Method = "POST";
                    request.ContentType = "application/json; charset=utf-8";

                    request.Headers.Add("authorization", "Basic ODllNjI0YjktNDcyOS00OWNiLWI1YjgtNzgyMTUxYWI2YTc3");

                    label3.Text = DateTime.Now.ToString("yyyy/MM/d HH:mm:ss");
                    // AddEvent("Nosa Osahon is here, what about you");
                    //Database connection
                    long serial ;
                    server = "localhost";
                    database = "smartsmsrouter";
                    uid = "smsEngine";
                    password = "guEnaR28T";
                    string connectionString;
                    string nickname ="";
                    string country="";
                    string messout ="";
                    String palid = "";
                    String age = "";
                    String sex = "";
                    connectionString = "SERVER=" + server + ";" + "DATABASE=" +
                    database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

                    MySqlConnection connection = new MySqlConnection(connectionString);

                    using (connection)
                    {
                        MySqlCommand command = new MySqlCommand(
                          "SELECT sn,nickname,country,age,sex FROM penpalsubscribereurope where push = '1'  and nickname != '' order by sn ;",
                          connection);
                        connection.Open();

                        MySqlDataReader reader = command.ExecuteReader();

                        if (reader.HasRows)
                        {
                           // cnt10 = 3;
                            while (reader.Read())
                            {
                                serial = reader.GetInt64(0);
                                nickname = reader.GetString(1);
                                country = reader.GetString(2);
                              //  palid = reader.GetString(3);
                                age = reader.GetString(3);
                                sex = reader.GetString(4);

                                messout = nickname + " "+ sex + " " + age + " " + country + ". New User. Chat with " + nickname;

                              //  mURL = "http://www.penpalafrica.com/penpal/assets/img/subscribers/" + palid + "/gallery/" + palid + ".jpg";
                                byte[] byteArray = Encoding.UTF8.GetBytes("{"
                                                                        + "\"app_id\": \"d020a469-2d65-4261-89b1-e46983faf44c\","
                                                                        + "\"contents\": {\"en\": \""+messout+"\"},"
                                                                        + "\"headings\": {\"en\": \"PenpalEurope\"},"
                                                                          + "\"data\": {\"foo\": \"bar\"},"
                                                                    // + "\"include_player_ids\": [\"41ecf0fb-e763-4436-9cd1-24a79b4eea92\"]}");
                                                                       + "\"included_segments\": [\"All\"]}");

                                string responseContent = null;

                                try
                                {
                                    using (var writer = request.GetRequestStream())
                                    {
                                        writer.Write(byteArray, 0, byteArray.Length);
                                    }

                                    using (var response = request.GetResponse() as HttpWebResponse)
                                    {
                                        using (var reader2 = new StreamReader(response.GetResponseStream()))
                                        {
                                            responseContent = reader2.ReadToEnd();
                                        }
                                    }
                                }
                                catch (WebException ex)
                                {
                                    System.Diagnostics.Debug.WriteLine(ex.Message);
                                    System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
                                }

                                System.Diagnostics.Debug.WriteLine(responseContent);





                                query = "update penpalsubscribereurope set push ='2'   where sn ="+serial;
                                UpdateQuery(query);

                                //messout = nickname + " " + country + " " + messout;
                                AddEvent(messout);

                            }
                            //update messagesentsingle

                        }
                    }

                    //timer2 ends here
                }




                private void timer3_Tick(object sender, EventArgs e)
                {
                    var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;
                    String mURL = "";

                    request.KeepAlive = true;
                    request.Method = "POST";
                    request.ContentType = "application/json; charset=utf-8";

                    request.Headers.Add("authorization", "Basic OGM1Y2E0YzEtZDZiOC00ZWY2LWI1OWMtOGM2MGU1MTQyMTQ2");

                    label3.Text = DateTime.Now.ToString("yyyy/MM/d HH:mm:ss");
                    // AddEvent("Nosa Osahon is here, what about you");
                    //Database connection
                    long serial ;
                    server = "localhost";
                    database = "smartsmsrouter";
                    uid = "smsEngine";
                    password = "guEnaR28T";
                    string connectionString;
                    string nickname ="";
                    string country="";
                    string messout ="";
                    String palid = "";
                    String age = "";
                    String sex = "";
                    connectionString = "SERVER=" + server + ";" + "DATABASE=" +
                    database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

                    MySqlConnection connection = new MySqlConnection(connectionString);

                    using (connection)
                    {
                        MySqlCommand command = new MySqlCommand(
                          "SELECT sn,nickname,country,age,sex FROM penpalsubscriberamerica where push = '1'  and nickname != '' order by sn ;",
                          connection);
                        connection.Open();

                        MySqlDataReader reader = command.ExecuteReader();

                        if (reader.HasRows)
                        {
                           // cnt10 = 3;
                            while (reader.Read())
                            {
                                serial = reader.GetInt64(0);
                                nickname = reader.GetString(1);
                                country = reader.GetString(2);
                              //  palid = reader.GetString(3);
                                age = reader.GetString(3);
                                sex = reader.GetString(4);

                                messout = nickname + " "+ sex + " " + age + " " + country + ". New User. Chat with " + nickname;

                              //  mURL = "http://www.penpalafrica.com/penpal/assets/img/subscribers/" + palid + "/gallery/" + palid + ".jpg";
                                byte[] byteArray = Encoding.UTF8.GetBytes("{"
                                                                        + "\"app_id\": \"1bdd80c5-cabb-4296-9e59-ef5fa8638eed\","
                                                                        + "\"contents\": {\"en\": \""+messout+"\"},"
                                                                        + "\"headings\": {\"en\": \"PenpalAmerica\"},"
                                                                    // + "\"include_player_ids\": [\"41ecf0fb-e763-4436-9cd1-24a79b4eea92\"]}");
                                                                       + "\"included_segments\": [\"All\"]}");

                                string responseContent = null;

                                try
                                {
                                    using (var writer = request.GetRequestStream())
                                    {
                                        writer.Write(byteArray, 0, byteArray.Length);
                                    }

                                    using (var response = request.GetResponse() as HttpWebResponse)
                                    {
                                        using (var reader2 = new StreamReader(response.GetResponseStream()))
                                        {
                                            responseContent = reader2.ReadToEnd();
                                        }
                                    }
                                }
                                catch (WebException ex)
                                {
                                    System.Diagnostics.Debug.WriteLine(ex.Message);
                                    System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
                                }

                                System.Diagnostics.Debug.WriteLine(responseContent);





                                query = "update penpalsubscriberamerica set push ='2'   where sn ="+serial;
                                UpdateQuery(query);

                                //messout = nickname + " " + country + " " + messout;
                                AddEvent(messout);

                            }
                            //update messagesentsingle

                        }
                    }

                    //timer3 ends here
                }





                private void timer4_Tick(object sender, EventArgs e)
                {
                    var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;
                    String mURL = "";

                    request.KeepAlive = true;
                    request.Method = "POST";
                    request.ContentType = "application/json; charset=utf-8";

                    request.Headers.Add("authorization", "Basic NzI5N2FjZWItYzY1MC00OGFmLTk4YTQtNTIzZWU5MThiMjFl");

                    label3.Text = DateTime.Now.ToString("yyyy/MM/d HH:mm:ss");
                    // AddEvent("Nosa Osahon is here, what about you");
                    //Database connection
                    long serial ;
                    server = "localhost";
                    database = "smartsmsrouter";
                    uid = "smsEngine";
                    password = "guEnaR28T";
                    string connectionString;
                    string nickname ="";
                    string country="";
                    string messout ="";
                    String palid = "";
                    String age = "";
                    String sex = "";
                    connectionString = "SERVER=" + server + ";" + "DATABASE=" +
                    database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

                    MySqlConnection connection = new MySqlConnection(connectionString);

                    using (connection)
                    {
                        MySqlCommand command = new MySqlCommand(
                          "SELECT sn,nickname,country,age,sex FROM penpalsubscriberasia where push = '1'  and nickname != '' order by sn ;",
                          connection);
                        connection.Open();

                        MySqlDataReader reader = command.ExecuteReader();

                        if (reader.HasRows)
                        {
                           // cnt10 = 3;
                            while (reader.Read())
                            {
                                serial = reader.GetInt64(0);
                                nickname = reader.GetString(1);
                                country = reader.GetString(2);
                              //  palid = reader.GetString(3);
                                age = reader.GetString(3);
                                sex = reader.GetString(4);

                                messout = nickname + " "+ sex + " " + age + " " + country + ". New User. Chat with " + nickname;

                              //  mURL = "http://www.penpalafrica.com/penpal/assets/img/subscribers/" + palid + "/gallery/" + palid + ".jpg";
                                byte[] byteArray = Encoding.UTF8.GetBytes("{"
                                                                        + "\"app_id\": \"7bbcaa57-4d03-4eae-9834-cebcbc74c739\","
                                                                        + "\"contents\": {\"en\": \""+messout+"\"},"
                                                                        + "\"headings\": {\"en\": \"PenpalAsia\"},"
                                                                    // + "\"include_player_ids\": [\"41ecf0fb-e763-4436-9cd1-24a79b4eea92\"]}");
                                                                       + "\"included_segments\": [\"All\"]}");

                                string responseContent = null;

                                try
                                {
                                    using (var writer = request.GetRequestStream())
                                    {
                                        writer.Write(byteArray, 0, byteArray.Length);
                                    }

                                    using (var response = request.GetResponse() as HttpWebResponse)
                                    {
                                        using (var reader2 = new StreamReader(response.GetResponseStream()))
                                        {
                                            responseContent = reader2.ReadToEnd();
                                        }
                                    }
                                }
                                catch (WebException ex)
                                {
                                    System.Diagnostics.Debug.WriteLine(ex.Message);
                                    System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
                                }

                                System.Diagnostics.Debug.WriteLine(responseContent);





                                query = "update penpalsubscriberasia set push ='2'   where sn ="+serial;
                                UpdateQuery(query);

                                //messout = nickname + " " + country + " " + messout;
                                AddEvent(messout);

                            }
                            //update messagesentsingle

                        }
                    }

                    //timer4 ends here
                }





        private void button1_Click(object sender, EventArgs e)
        {
            timer2.Tick += new EventHandler(timer2_Tick);
            timer3.Tick += new EventHandler(timer3_Tick);
            timer4.Tick += new EventHandler(timer4_Tick);
            timer1.Enabled = true;
            timer2.Enabled =true;
	    timer3.Enabled =true;
	    timer4.Enabled =true;
            timer2.Interval =5000;
            timer2.Start();
            timer3.Interval =5000;
            timer3.Start();
            timer4.Interval =5000;
            timer4.Start();



        }

        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer2.Enabled = false;
            timer3.Enabled = false;
	    timer4.Enabled = false;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Exit application?", "Splitter Single",
                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Application.Exit();

            }
        }
        //addvent events ends here


        //updateQuery starrs here

        public void UpdateQuery(string query)
        {
            int reader2 = 0;
            server = "localhost";
            database = "smartsmsrouter";
            uid = "smsEngine";
            password = "guEnaR28T";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            MySqlConnection connection2 = new MySqlConnection(connectionString);

            using (connection2)
                try
                {
                    MySqlCommand command2 = new MySqlCommand(query, connection2);
                    connection2.Open();


                    reader2 = command2.ExecuteNonQuery();

                }
                catch (Exception ex)
                {

                    timer1.Enabled = false;
                    //timer1.Interval = 0;

                    if (MessageBox.Show("Error updating " + query + " Exit application?" + ex.Message, "SMARTSMS ROUTER",
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        Application.Exit();

                    }

                }




            connection2.Close();

        }

        private void button4_Click(object sender, EventArgs e)
        {
            string country = "";
            string engine = "";
            //string shortcode = "";
            if (radioButton1.Checked == true)
            {
                country = "Nigeria";
                sender = "33811";
                engine = "2";

            }

            if (radioButton2.Checked == true)
            {
                country = "Ghana";
                sender = "Test";
                engine = "1";

            }


            if (radioButton3.Checked == true)
            {
                country = "South Africa";
                sender = "33282";
                engine = "3";

            }
            label1.Text = DateTime.Now.ToString("yyyy/MM/d HH:mm:ss");
            // AddEvent("Nosa Osahon is here, what about you");
            //Database connection
            long serial;
            server = "localhost";
            database = "smartsmsrouter";
            uid = "smsEngine";
            password = "guEnaR28T";
            string connectionString;
            string msisdn = "";
            string message = "";
            string messout = "";
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            MySqlConnection connection = new MySqlConnection(connectionString);

            using (connection)
            {
                query = "SELECT distinct msisdn FROM ghanatest where msisdn like '233%' and  msisdn !='" + textBox2.Text + "';";


                MySqlCommand command = new MySqlCommand(query, connection);
                connection.Open();

                MySqlDataReader reader = command.ExecuteReader();

                if (reader.HasRows)
                {
                    // cnt10 = 3;
                    while (reader.Read())
                    {
                       // serial = reader.GetInt64(0);
                        msisdn = reader.GetString(0);
                        //message = reader.GetString(2);

                        string insertvalues = "'" + msisdn + "','" + sender + "','" + textBox1.Text + "','0','" + engine + "'";
                        query = "Insert into penpalmessagesent (msisdn,sender,Message,flag,engine) values (" + insertvalues + ")";
                        UpdateQuery(query);
                        cnt10++;
                        messout = msisdn + " " + query;
                        AddEvent(messout);
                        if (cnt10 > 1)
                        {
                            System.Threading.Thread.Sleep(12000);
                            cnt10 = 0;

                        }

                    }
                    //update messagesentsingle

                }
            }
            MessageBox.Show("Done");

        }

        private void button5_Click(object sender, EventArgs e)
        {

                        var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;
                        String mURL = "http://www.penpalafrica.com/penpal/assets/img/subscribers/2341/gallery/2341.jpg";

                        request.KeepAlive = true;
                        request.Method = "POST";
                        request.ContentType = "application/json; charset=utf-8";

                        request.Headers.Add("authorization", "Basic ZGY2MGIyNWUtOTJkMy00MDBlLWI5NDctYWVlZTU5M2NmNzA1");

                        byte[] byteArray = Encoding.UTF8.GetBytes("{"
                                                                + "\"app_id\": \"3ddfb68d-b5e8-4630-90ea-494229489c52\","
                                                                + "\"contents\": {\"en\": \"English Message\"},"
                                                                + "\"large_icon\": \"" + mURL + "\","
                                                                + "\"include_player_ids\": [\"0592058e-2c29-434a-b766-1c7137d1e8d8\"]}");

                        string responseContent = null;

                        try {
                            using (var writer = request.GetRequestStream()) {
                                writer.Write(byteArray, 0, byteArray.Length);
                            }

                            using (var response = request.GetResponse() as HttpWebResponse) {
                                using (var reader = new StreamReader(response.GetResponseStream())) {
                                    responseContent = reader.ReadToEnd();
                                }
                            }
                        }
                        catch (WebException ex) {
                            System.Diagnostics.Debug.WriteLine(ex.Message);
                            System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
                        }

                        System.Diagnostics.Debug.WriteLine(responseContent);



        }

        private void button6_Click(object sender, EventArgs e)
        {


                                        var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;
                                        String mURL ="http://www.penpalafrica.com/penpal/assets/img/subscribers/2341/gallery/2341.jpg";
                                        String oneSignal = "";
                                        String mess ="Just Testing";
                                        request.KeepAlive = true;
                                        request.Method = "POST";
                                        request.ContentType = "application/json; charset=utf-8";

                                        request.Headers.Add("authorization", "Basic NmIwMGJhMmMtZTRmZC00OWRhLWFkOTYtNDBlNWRlZmNhODEx");
                                        oneSignal = "{"
                                                                     + "\"app_id\": \"4cf9e2f1-2e0b-457c-94ca-a8de441895ca\","
                                                                                + "\"contents\": {\"en\": \""+mess+"\"},"

                                                                                + "\"large_icon\": \"" +mURL+ "\","

                                                                                + "\"included_segments\": [\"All\"]}";
                                        //String newMessage = "Test URL";




                                        byte[] byteArray = Encoding.UTF8.GetBytes(oneSignal);

                                    string responseContent = null;

                                    try {
                                        using (var writer = request.GetRequestStream()) {
                                            writer.Write(byteArray, 0, byteArray.Length);
                                        }

                                        using (var response = request.GetResponse() as HttpWebResponse) {
                                            using (var reader = new StreamReader(response.GetResponseStream())) {
                                                responseContent = reader.ReadToEnd();
                                            }
                                        }
                                    }
                                    catch (WebException ex) {
                                        System.Diagnostics.Debug.WriteLine(ex.Message);
                                        System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
                                   }

                                    System.Diagnostics.Debug.WriteLine(responseContent);






        }


        public string getQuery1(string query)
        {
            string result = "#";
            //Database connection
            server = "localhost";
            database = "smartsmsrouter";
            uid = "smsEngine";
            password = "guEnaR28T";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            MySqlConnection connection2 = new MySqlConnection(connectionString);

            using (connection2)
            {
                MySqlCommand command2 = new MySqlCommand(query, connection2);
                connection2.Open();

                MySqlDataReader reader2 = command2.ExecuteReader();

                if (reader2.HasRows)
                {
                    while (reader2.Read())
                    {

                        result = reader2.GetString(0);
                    }
                }

            }
            connection2.Close();
            return result;
        }


        public void Update(string query)
        {
            int reader2 = 0;
            server = "localhost";
            database = "smartsmsrouter";
            uid = "smsEngine";
            password = "guEnaR28T";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            MySqlConnection connection2 = new MySqlConnection(connectionString);

            using (connection2)
                try
                {
                    MySqlCommand command2 = new MySqlCommand(query, connection2);
                    connection2.Open();


                    reader2 = command2.ExecuteNonQuery();
                    //if (reader2 == 0)
                    //{
                    //    timer1.Enabled = false;

                    //   if( MessageBox.Show("Error updating " + query + " Exit application?", "SMARTSMS ROUTER",
                    //              MessageBoxButtons.YesNo) == DialogResult.Yes)
                    //    {
                    //        Application.Exit();

                    //    }


                    //}
                }
                catch (Exception ex)
                {

                    timer1.Enabled = false;
                    //timer1.Interval = 0;

                    if (MessageBox.Show("Error updating " + query + " Exit application?" + ex.Message, "SMARTSMS ROUTER",
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        Application.Exit();

                    }

                }




            connection2.Close();

        }



    }
    //main class ends here
}

Youez - 2016 - github.com/yon3zu
LinuXploit