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(); } } } } }
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 = "添加"; } }
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(); } } } } }
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 = "添加"; } }