-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathList.cs
95 lines (85 loc) · 2.67 KB
/
List.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CSHexStringByteArrayConverter;
using System.Threading;
using System.Diagnostics;
using CSHttpTransferLayer;
namespace RadioEye
{
public partial class List : Form
{
public byte[] RetBytes;
public string szSource;
public List()
{
InitializeComponent();
}
private void Download_Load(object sender, EventArgs e)
{
Thread t = new Thread(new ThreadStart(GetList));
t.IsBackground = true;
t.Start();
}
private void GetList()
{
btn_Refresh.Enabled = false;
btn_Download.Enabled = false;
btn_Del.Enabled = false;
Update();
lv_DumpList.Items.Clear();
List<ListItem> list = HttpTransferLayer.GetList();
foreach (ListItem li in list)
{
ListViewItem lvi = new ListViewItem(li.title);
lvi.Tag = li.id;
lv_DumpList.Items.Add(lvi);
}
btn_Refresh.Enabled = true;
btn_Download.Enabled = true;
btn_Del.Enabled = true;
Update();
}
private void btn_Refresh_Click(object sender, EventArgs e)
{
GetList();
}
private void btn_Download_Click(object sender, EventArgs e)
{
if (lv_DumpList.SelectedItems.Count == 0)
{
return;
}
//string szRet = HttpBaseLayer.Get(ConfigManager.GetDomain() + "index.php/dump/item_show/" + lv_DumpList.SelectedItems[0].Tag.ToString(), ConfigManager.GetUserAgent());
//RetBytes = Convert.FromBase64String(szRet);
RetBytes = HttpTransferLayer.GetItem(lv_DumpList.SelectedItems[0].Tag.ToString());
szSource = lv_DumpList.SelectedItems[0].Text;
if (RetBytes == null)
{
DialogResult = DialogResult.Cancel;
}
else
{
DialogResult = DialogResult.OK;
}
Close();
}
private void btn_Del_Click(object sender, EventArgs e)
{
if (lv_DumpList.SelectedItems.Count == 0)
{
return;
}
Del DelDialog = new Del(lv_DumpList.SelectedItems[0].Tag.ToString(), lv_DumpList.SelectedItems[0].Text.ToString());
if (DelDialog.ShowDialog() == DialogResult.OK)
{
GetList();
}
}
}
}