예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            postquery postauth;

            postauth = new postquery();
            string auth = postauth.post("http://dle.ru/profile.php", "login="******"&password="******"false")
            {
                MessageBox.Show("Неверное имя пользователя или пароль!");
            }
            else
            {
                panel1.Visible = false;
                Root q = JsonConvert.DeserializeObject <Root>(auth);
                label3.Text = q.fullname;
                label4.Text = q.email;
                pictureBox1.ImageLocation = q.foto;
                pictureBox1.SizeMode      = PictureBoxSizeMode.StretchImage;

                if (q.user_group == "1")
                {
                    label6.Text = "Администратор";
                }
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            postquery postauth;
             postauth = new postquery();
             string auth = postauth.post("http://dle.ru/profile.php", "login="******"&password="******"false")
             {
                 MessageBox.Show("Неверное имя пользователя или пароль!");
             }
             else
             {
                 panel1.Visible = false;
                 Root q = JsonConvert.DeserializeObject<Root>(auth);
                 label3.Text = q.fullname;
                 label4.Text = q.email;
                 pictureBox1.ImageLocation = q.foto;
                 pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;

                 if(q.user_group == "1")
                 {
                     label6.Text = "Администратор";
                 }
             }
        }
예제 #3
0
        //=========================================================//
        // Инициализация новостной панели,отправка post запроса... //
        //=========================================================//
        public news_panel()
        {
            InitializeComponent();
            ////////////////
            label1.Parent    = this.pictureBox1;
            label2.Parent    = this.pictureBox2;
            label3.Parent    = this.pictureBox3;
            label4.Parent    = this.pictureBox4;
            label5.Parent    = this.pictureBox5;
            label1.BackColor = Color.FromArgb(0, Color.White);
            label2.BackColor = Color.FromArgb(0, Color.White);
            label3.BackColor = Color.FromArgb(0, Color.White);
            label4.BackColor = Color.FromArgb(0, Color.White);
            label5.BackColor = Color.FromArgb(0, Color.White);
            /////////////////
            postquery postnews;

            postnews = new postquery();
            string   newspost = postnews.post("http://5game.su/test.php", "");
            Newspost news     = JsonConvert.DeserializeObject <Newspost>(newspost);

            pictureBox1.ImageLocation = news.answer[0].short_story;
            pictureBox1.SizeMode      = PictureBoxSizeMode.StretchImage;
            pictureBox2.ImageLocation = news.answer[1].short_story;
            pictureBox2.SizeMode      = PictureBoxSizeMode.StretchImage;
            pictureBox3.ImageLocation = news.answer[2].short_story;
            pictureBox3.SizeMode      = PictureBoxSizeMode.StretchImage;
            pictureBox4.ImageLocation = news.answer[3].short_story;
            pictureBox4.SizeMode      = PictureBoxSizeMode.StretchImage;
            pictureBox5.ImageLocation = news.answer[4].short_story;
            pictureBox5.SizeMode      = PictureBoxSizeMode.StretchImage;
            ///////////////////
            label1.Text = news.answer[0].title;
            label2.Text = news.answer[1].title;
            label3.Text = news.answer[2].title;
            label4.Text = news.answer[3].title;
            label5.Text = news.answer[4].title;
            //////////////////
            site1 = "http://5game.su/" + news.answer[0].id + "-" + news.answer[0].alt_name + ".html";
            site2 = "http://5game.su/" + news.answer[1].id + "-" + news.answer[1].alt_name + ".html";
            site3 = "http://5game.su/" + news.answer[2].id + "-" + news.answer[2].alt_name + ".html";
            site4 = "http://5game.su/" + news.answer[3].id + "-" + news.answer[3].alt_name + ".html";
            site5 = "http://5game.su/" + news.answer[4].id + "-" + news.answer[4].alt_name + ".html";
            /////////////////
        }
예제 #4
0
 //=========================================================//
 // Инициализация новостной панели,отправка post запроса... //
 //=========================================================//
 public news_panel()
 {
     InitializeComponent();
     ////////////////
     label1.Parent = this.pictureBox1;
     label2.Parent = this.pictureBox2;
     label3.Parent = this.pictureBox3;
     label4.Parent = this.pictureBox4;
     label5.Parent = this.pictureBox5;
     label1.BackColor = Color.FromArgb(0, Color.White);
     label2.BackColor = Color.FromArgb(0, Color.White);
     label3.BackColor = Color.FromArgb(0, Color.White);
     label4.BackColor = Color.FromArgb(0, Color.White);
     label5.BackColor = Color.FromArgb(0, Color.White);
     /////////////////
     postquery postnews;
     postnews = new postquery();
     string newspost = postnews.post("http://5game.su/test.php", "");
     Newspost news = JsonConvert.DeserializeObject<Newspost>(newspost);
     pictureBox1.ImageLocation = news.answer[0].short_story;
     pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
     pictureBox2.ImageLocation = news.answer[1].short_story;
     pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
     pictureBox3.ImageLocation = news.answer[2].short_story;
     pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
     pictureBox4.ImageLocation = news.answer[3].short_story;
     pictureBox4.SizeMode = PictureBoxSizeMode.StretchImage;
     pictureBox5.ImageLocation = news.answer[4].short_story;
     pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
     ///////////////////
     label1.Text = news.answer[0].title;
     label2.Text = news.answer[1].title;
     label3.Text = news.answer[2].title;
     label4.Text = news.answer[3].title;
     label5.Text = news.answer[4].title;
     //////////////////
      site1 = "http://5game.su/" + news.answer[0].id + "-" + news.answer[0].alt_name + ".html";
      site2 = "http://5game.su/" + news.answer[1].id + "-" + news.answer[1].alt_name + ".html";
      site3 = "http://5game.su/" + news.answer[2].id + "-" + news.answer[2].alt_name + ".html";
      site4 = "http://5game.su/" + news.answer[3].id + "-" + news.answer[3].alt_name + ".html";
      site5 = "http://5game.su/" + news.answer[4].id + "-" + news.answer[4].alt_name + ".html";
     /////////////////
 }