예제 #1
0
        private void xiazai_Click(object sender, EventArgs e)
        {
            if (moddl != "")
            {
                http http = new http();
                noenable();
                xiazai.Enabled = false;
                xiazai.Visible = false;

                http.DownloadFile(moddl, @".\temp\mod\workshop-" + modid + ".zip", dlabel);
                xiazai.Enabled = true;
                enable();
                MessageBox.Show("下载成功~");
                string path = @".\temp\mod\";
                System.Diagnostics.Process.Start("explorer.exe", path);
            }
        }
예제 #2
0
        private void 查看详情ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem lvi in listView1.SelectedItems)  //选中项遍历
            {
                string sub = "mid=" + lvi.Text;

                http   tp   = new http();
                string back = tp.HttpPost(modurl, sub);

                var jObject = JObject.Parse(back);
                if (jObject["code"].ToString() == "200")
                {
                    if (jObject["title"] != null)
                    {
                        label2.Text = jObject["title"].ToString();
                        if (jObject["des"] != null)
                        {
                            textBox2.Text = jObject["des"].ToString();
                        }
                    }
                }
            }
        }
예제 #3
0
        private void 检查更新ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            update up = new update();

            http    h    = new http();
            string  bd   = h.HttpGet(@"http://t.vvwall.com/DST/version.php", "");
            JObject json = JObject.Parse(bd);

            if (Int32.Parse(version) < Int32.Parse(json["version"].ToString()))
            {
                up.url      = json["url"].ToString();
                up.timeq    = json["time"].ToString();
                up.des      = json["des"].ToString();
                up.titletxt = json["title"].ToString();
                up.must     = json["must"].ToString();
                up.gg       = json["gg"].ToString();
            }
            if (up.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("你必须更新新版本才能使用");
                this.Close();
            }
        }
예제 #4
0
        private void checkup()
        {
            timer1.Enabled = false;
            update  up   = new update();
            http    h    = new http();
            string  bd   = h.HttpGet(@"http://t.vvwall.com/DST/version.php", "");
            JObject json = JObject.Parse(bd);

            if (Int32.Parse(version) < Int32.Parse(json["version"].ToString()))
            {
                up.url      = json["url"].ToString();
                up.timeq    = json["time"].ToString();
                up.des      = json["des"].ToString();
                up.titletxt = json["title"].ToString();
                up.must     = json["must"].ToString();
                up.gg       = json["gg"].ToString();
                if (up.ShowDialog() == DialogResult.OK)
                {
                    MessageBox.Show("你必须更新新版本才能使用");
                    this.Close();
                }
            }
        }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            button1.Text = "加载中";
            button1.Enabled = false;
            textBox1.Enabled = false;
            if (textBox1.Text == "")
            {
                MessageBox.Show("请填写mod编号");
                button1.Enabled = true;
                textBox1.Enabled = true;
                button1.Text = "添加";
            }
            else {
             string sub = "mid="+textBox1.Text;

             http tp = new http();
              string back= tp.HttpPost(modurl,sub);

                  var jObject = JObject.Parse(back);
                  if(jObject["code"].ToString()=="200"){

                   ListViewItem lvi = new ListViewItem();

                  lvi.Text = jObject["mid"].ToString();

                  if (checkhas(lvi.Text)) {
                      MessageBox.Show("已经添加了【"+lvi.Text+"】这个mod");
                      button1.Enabled = true;
                      textBox1.Enabled = true;
                      button1.Text = "添加";
                      return;//中断
                  }
                  modid = lvi.Text;
                  if (jObject["title"] != null)
                  {
                      lvi.SubItems.Add(jObject["title"].ToString());

                      label2.Text = jObject["title"].ToString();
                      if (jObject["des"] != null) {
                          textBox2.Text = jObject["des"].ToString();
                      }
                  }
                  if (jObject["url"] != null) {
                     moddl =jObject["url"].ToString();
                  }
                  //可下载的
                  xiazai.Visible = true;
                  lvi.Checked = true;
                  listView1.Items.Add(lvi);
                  MessageBox.Show("添加成功");
                  button5.Visible = true;
                  button4.Visible = true;
                  }else{
                      if (jObject["code"].ToString() == "404")
                      {
                          MessageBox.Show("部分功能不能使用");
                      }
                      else {
                          MessageBox.Show("未找到该mod");
                      }

                  }
                  button1.Enabled = true;
                  textBox1.Enabled = true;
                  button1.Text = "添加";
              }
        }
예제 #6
0
        private void 查看详情ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem lvi in listView1.SelectedItems)  //选中项遍历
            {
                string sub = "mid=" +lvi.Text;

                http tp = new http();
                string back = tp.HttpPost(modurl, sub);

                var jObject = JObject.Parse(back);
                if (jObject["code"].ToString() == "200")
                {
                    if (jObject["title"] != null)
                    {

                        label2.Text = jObject["title"].ToString();
                        if (jObject["des"] != null)
                        {
                            textBox2.Text = jObject["des"].ToString();
                        }
                    }
                }
            }
        }
예제 #7
0
        private void xiazai_Click(object sender, EventArgs e)
        {
            if (moddl != "") {
                http http = new http();
                noenable();
                xiazai.Enabled = false;
                xiazai.Visible = false;

                http.DownloadFile(moddl,@".\temp\mod\workshop-"+modid+".zip",dlabel);
                xiazai.Enabled = true;
                enable();
                MessageBox.Show("下载成功~");
                string path = @".\temp\mod\";
                System.Diagnostics.Process.Start("explorer.exe", path);
            }
        }
예제 #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            button1.Text     = "加载中";
            button1.Enabled  = false;
            textBox1.Enabled = false;
            if (textBox1.Text == "")
            {
                MessageBox.Show("请填写mod编号");
                button1.Enabled  = true;
                textBox1.Enabled = true;
                button1.Text     = "添加";
            }
            else
            {
                string sub = "mid=" + textBox1.Text;

                http   tp   = new http();
                string back = tp.HttpPost(modurl, sub);

                var jObject = JObject.Parse(back);
                if (jObject["code"].ToString() == "200")
                {
                    ListViewItem lvi = new ListViewItem();

                    lvi.Text = jObject["mid"].ToString();

                    if (checkhas(lvi.Text))
                    {
                        MessageBox.Show("已经添加了【" + lvi.Text + "】这个mod");
                        button1.Enabled  = true;
                        textBox1.Enabled = true;
                        button1.Text     = "添加";
                        return;//中断
                    }
                    modid = lvi.Text;
                    if (jObject["title"] != null)
                    {
                        lvi.SubItems.Add(jObject["title"].ToString());

                        label2.Text = jObject["title"].ToString();
                        if (jObject["des"] != null)
                        {
                            textBox2.Text = jObject["des"].ToString();
                        }
                    }
                    if (jObject["url"] != null)
                    {
                        moddl = jObject["url"].ToString();
                    }
                    //可下载的
                    xiazai.Visible = true;
                    lvi.Checked    = true;
                    listView1.Items.Add(lvi);
                    MessageBox.Show("添加成功");
                    button5.Visible = true;
                    button4.Visible = true;
                }
                else
                {
                    if (jObject["code"].ToString() == "404")
                    {
                        MessageBox.Show("部分功能不能使用");
                    }
                    else
                    {
                        MessageBox.Show("未找到该mod");
                    }
                }
                button1.Enabled  = true;
                textBox1.Enabled = true;
                button1.Text     = "添加";
            }
        }
예제 #9
0
        private void 检查更新ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            update up = new update();

               http h = new http();
               string bd = h.HttpGet(@"http://t.vvwall.com/DST/version.php", "");
               JObject json = JObject.Parse(bd);

               if (Int32.Parse(version) < Int32.Parse(json["version"].ToString()))
               {
               up.url = json["url"].ToString();
               up.timeq = json["time"].ToString();
               up.des = json["des"].ToString();
               up.titletxt = json["title"].ToString();
               up.must = json["must"].ToString();
               up.gg = json["gg"].ToString();

               }
               if (up.ShowDialog() == DialogResult.OK) {
               MessageBox.Show("你必须更新新版本才能使用");
               this.Close();
               }
        }
예제 #10
0
 private void checkup()
 {
     timer1.Enabled = false;
     update up = new update();
     http h = new http();
     string bd = h.HttpGet(@"http://t.vvwall.com/DST/version.php", "");
     JObject json = JObject.Parse(bd);
     if (Int32.Parse(version) < Int32.Parse(json["version"].ToString()))
     {
         up.url = json["url"].ToString();
         up.timeq = json["time"].ToString();
         up.des = json["des"].ToString();
         up.titletxt = json["title"].ToString();
         up.must = json["must"].ToString();
         up.gg = json["gg"].ToString();
         if (up.ShowDialog() == DialogResult.OK)
         {
             MessageBox.Show("你必须更新新版本才能使用");
             this.Close();
         }
     }
 }