mirror of
https://git.oceanpay.cc/danial/kami_itunes_june.git
synced 2025-12-18 22:31:24 +00:00
1001 lines
35 KiB
C#
1001 lines
35 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Drawing;
|
||
using System.Linq;
|
||
using System.Media;
|
||
using System.Runtime.InteropServices;
|
||
using System.Text.RegularExpressions;
|
||
using System.Threading.Tasks;
|
||
using System.Windows.Forms;
|
||
using AppleBatch_June.ExecuteTasks;
|
||
using AppleBatch_June.Model;
|
||
using AppleBatch_June.Properties;
|
||
|
||
namespace AppleBatch_June
|
||
{
|
||
public class FormIntervalRedeem : BaseForm
|
||
{
|
||
public struct FLASHWINFO
|
||
{
|
||
public uint cbSize;
|
||
|
||
public IntPtr hwnd;
|
||
|
||
public uint dwFlags;
|
||
|
||
public uint uCount;
|
||
|
||
public uint dwTimeout;
|
||
}
|
||
|
||
public List<IntervalIdModel> intervalIdModels = new List<IntervalIdModel>();
|
||
|
||
private SoundPlayer sp;
|
||
|
||
public bool isStartRun;
|
||
|
||
public DateTime expirationTime = DateTime.Now;
|
||
|
||
private bool expirationExecuted;
|
||
|
||
public const uint FLASHW_TRAY = 2u;
|
||
|
||
public const uint FLASHW_TIMERNOFG = 12u;
|
||
|
||
public const uint FLASHW_PARAM2 = 4u;
|
||
|
||
private IContainer components;
|
||
|
||
private ListView listcycleRedeemIdList;
|
||
|
||
private ColumnHeader columnHeader1;
|
||
|
||
private ColumnHeader columnHeader2;
|
||
|
||
private GroupBox groupBox1;
|
||
|
||
private ColumnHeader columnHeader10;
|
||
|
||
private Button btnStartRedeem;
|
||
|
||
private CheckBox ckcycleSingleProcessRedeem;
|
||
|
||
private CheckBox ckCycleRemoteReddem;
|
||
|
||
private CheckBox ckCycleReddenVpn;
|
||
|
||
private ColumnHeader columnHeader11;
|
||
|
||
private ColumnHeader columnHeader4;
|
||
|
||
private CheckBox checkBox2;
|
||
|
||
private ColumnHeader columnHeader5;
|
||
|
||
private ColumnHeader columnHeader6;
|
||
|
||
private Button btnTestAccount;
|
||
|
||
private Label label45;
|
||
|
||
private TextBox txtCycleLoadAccount;
|
||
|
||
private Label label1;
|
||
|
||
private Label label3;
|
||
|
||
private TextBox txtSepTime;
|
||
|
||
private Label label2;
|
||
|
||
private Label label4;
|
||
|
||
private Label label7;
|
||
|
||
private Button btnReddenInput;
|
||
|
||
private Button button1;
|
||
|
||
private Button btnStopRemovePay;
|
||
|
||
private Button button2;
|
||
|
||
private Label labCheckAcountMsg;
|
||
|
||
private Label labTestDianshu;
|
||
|
||
private Label label47;
|
||
|
||
private ColumnHeader columnHeader3;
|
||
|
||
private Button btnExecuted;
|
||
|
||
private Label label14;
|
||
|
||
public FormIntervalRedeem()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
|
||
private void FormIntervalRedeem_Load(object sender, EventArgs e)
|
||
{
|
||
sp = new SoundPlayer(Resources.UI_success);
|
||
labTestDianshu.Text = AppSysConfig.getTypeById(9).consNum.ToString();
|
||
ckCycleReddenVpn.Checked = ((ConfigUtlis.getConfigValue("ckCycleReddenVpn") == "True") ? true : false);
|
||
ckCycleRemoteReddem.Checked = ((ConfigUtlis.getConfigValue("ckCycleRemoteReddem") == "True") ? true : false);
|
||
ckcycleSingleProcessRedeem.Checked = ((!(ConfigUtlis.getConfigValue("ckcycleSingleProcessRedeem") == "false")) ? true : false);
|
||
txtCycleLoadAccount.Text = ConfigUtlis.getConfigValue("txtCycleLoadAccount");
|
||
if (string.IsNullOrEmpty(txtCycleLoadAccount.Text))
|
||
{
|
||
txtCycleLoadAccount.Text = "账号输入格式:xxxx@xxx.com----密码";
|
||
}
|
||
label14.Text = AppSysConfig.getConfig("cycleRedeemTip");
|
||
InitLv(listcycleRedeemIdList);
|
||
BindMenuStrip();
|
||
}
|
||
|
||
public override void ReExecute_Click(object sender, EventArgs e)
|
||
{
|
||
if (CycleReddemTask.Instance.TaskIsRun)
|
||
{
|
||
MessageBox.Show("兑换进行中, 请等待.");
|
||
return;
|
||
}
|
||
List<AppleAcount> list = new List<AppleAcount>();
|
||
foreach (ListViewItem selectedItem in listcycleRedeemIdList.SelectedItems)
|
||
{
|
||
list.Add(new AppleAcount
|
||
{
|
||
reddemCode = selectedItem.SubItems[3].Text,
|
||
appleId = selectedItem.SubItems[1].Text,
|
||
applePwd = selectedItem.SubItems[2].Text,
|
||
overflow = selectedItem.SubItems[4].Text
|
||
});
|
||
}
|
||
applyRedeem(list);
|
||
}
|
||
|
||
private void btnInpueIdList_Click(object sender, EventArgs e)
|
||
{
|
||
FromInputAcount fromInputAcount = new FromInputAcount();
|
||
fromInputAcount.tipMssage = "账号---密码";
|
||
fromInputAcount.isOpenSysVpn = ckCycleReddenVpn.Checked;
|
||
if (fromInputAcount.ShowDialog() != DialogResult.OK)
|
||
{
|
||
return;
|
||
}
|
||
List<AppleAcount> list = AppleUtlis.accountInput(fromInputAcount.StrInput);
|
||
int num = 0;
|
||
string text = "";
|
||
foreach (AppleAcount appleItem in list)
|
||
{
|
||
if (!string.IsNullOrEmpty(appleItem.appleId) && !string.IsNullOrEmpty(appleItem.applePwd))
|
||
{
|
||
if (intervalIdModels.Where((IntervalIdModel c) => c.appleId.Trim() == appleItem.appleId.Trim()).FirstOrDefault() == null)
|
||
{
|
||
num++;
|
||
ListViewItem listViewItem = new ListViewItem(num.ToString());
|
||
listViewItem.SubItems.Add(appleItem.appleId.Trim());
|
||
listViewItem.SubItems.Add(appleItem.applePwd.Trim());
|
||
listViewItem.SubItems.Add("0");
|
||
listViewItem.SubItems.Add("0");
|
||
listViewItem.SubItems.Add("");
|
||
listViewItem.UseItemStyleForSubItems = false;
|
||
listcycleRedeemIdList.Items.Add(listViewItem);
|
||
intervalIdModels.Add(new IntervalIdModel
|
||
{
|
||
appleId = appleItem.appleId.Trim(),
|
||
applePwd = appleItem.applePwd.Trim(),
|
||
intervalCarts = new List<IntervalCartModel>(),
|
||
state = 0,
|
||
msg = ""
|
||
});
|
||
}
|
||
else
|
||
{
|
||
text = text + appleItem.appleId.Trim() + "已存在,";
|
||
}
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(text.TrimEnd(',')))
|
||
{
|
||
MessageBox.Show(text);
|
||
}
|
||
}
|
||
|
||
private void btnInputCartAndStart_Click(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
private void listIntervalRedeemIdList_MouseClick(object sender, MouseEventArgs e)
|
||
{
|
||
}
|
||
|
||
private void button1_Click(object sender, EventArgs e)
|
||
{
|
||
}
|
||
|
||
private void btnTestAccount_Click(object sender, EventArgs e)
|
||
{
|
||
if (txtCycleLoadAccount.Text != "账号输入格式:xxxx@xxx.com----密码")
|
||
{
|
||
List<AppleAcount> listAccount = AppleUtlis.accountInput(txtCycleLoadAccount.Text.Trim());
|
||
if (listAccount.Count == 1)
|
||
{
|
||
labCheckAcountMsg.Text = listAccount[0].appleId + " 正在检测";
|
||
btnTestAccount.Enabled = false;
|
||
AccountCheckTask.Instance.appleAccountCheck(listAccount[0], delegate(string message, AppleItunesLogin loginItunes)
|
||
{
|
||
labCheckAcountMsg.Text = listAccount[0].appleId + " 检测结果: " + message;
|
||
btnTestAccount.Enabled = true;
|
||
}, null, ckCycleReddenVpn.Checked);
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("账号输入格式不正确");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入账号");
|
||
}
|
||
}
|
||
|
||
private void txtCycleLoadAccount_Enter(object sender, EventArgs e)
|
||
{
|
||
if (txtCycleLoadAccount.Text == "账号输入格式:xxxx@xxx.com----密码")
|
||
{
|
||
txtCycleLoadAccount.Text = "";
|
||
}
|
||
}
|
||
|
||
private void txtCycleLoadAccount_Leave(object sender, EventArgs e)
|
||
{
|
||
if (string.IsNullOrEmpty(txtCycleLoadAccount.Text))
|
||
{
|
||
txtCycleLoadAccount.Text = "账号输入格式:xxxx@xxx.com----密码";
|
||
}
|
||
}
|
||
|
||
private void btnReddenInput_Click(object sender, EventArgs e)
|
||
{
|
||
List<AppleAcount> list = AppleUtlis.accountInput(txtCycleLoadAccount.Text.Trim());
|
||
FromInputAcount fromInputAcount = new FromInputAcount();
|
||
fromInputAcount.tipMssage = "请按格式导入卡密";
|
||
if (fromInputAcount.ShowDialog() != DialogResult.OK)
|
||
{
|
||
return;
|
||
}
|
||
listcycleRedeemIdList.ListViewItemSorter = new ListViewItemComparer(0, 1);
|
||
listcycleRedeemIdList.Sort();
|
||
int num = 0;
|
||
if (listcycleRedeemIdList.Items.Count > 0 && int.TryParse(listcycleRedeemIdList.Items[listcycleRedeemIdList.Items.Count - 1].SubItems[0].Text, out var result))
|
||
{
|
||
num = result;
|
||
}
|
||
List<string> list2 = new List<string>();
|
||
string[] array = fromInputAcount.StrInput.Split('\n');
|
||
int num2 = 0;
|
||
while (true)
|
||
{
|
||
if (num2 >= array.Length)
|
||
{
|
||
return;
|
||
}
|
||
string item = array[num2];
|
||
if (!string.IsNullOrEmpty(item))
|
||
{
|
||
string[] array2 = (from c in item.Split('-')
|
||
where !string.IsNullOrEmpty(c)
|
||
select c).ToArray();
|
||
string text = "";
|
||
string text2 = "";
|
||
string[] array3;
|
||
if (array2.Count() == 1)
|
||
{
|
||
if (list.Count == 0)
|
||
{
|
||
break;
|
||
}
|
||
text = list[0].appleId;
|
||
text2 = list[0].applePwd;
|
||
if (!string.IsNullOrEmpty(list[0].appleQt1))
|
||
{
|
||
_ = list[0].appleQt1 + "," + list[0].appleQt2 + "," + list[0].appleQt3;
|
||
}
|
||
array3 = new string[1] { array2[0] };
|
||
}
|
||
else if (array2.Count() >= 3)
|
||
{
|
||
string config = AppSysConfig.getConfig("AccountInputRegex");
|
||
string text3 = Regex.Match(item, config).Value.Trim();
|
||
if (!string.IsNullOrEmpty(text3))
|
||
{
|
||
text = text3;
|
||
array2 = (from c in item.Substring(text.Length).Replace("[-]", "{\0}").Replace("{-}", "{\0}")
|
||
.Split('-')
|
||
where !string.IsNullOrEmpty(c)
|
||
select c.Replace("{\0}", "-")).ToArray();
|
||
text2 = array2[0].Trim();
|
||
array3 = array2.Skip(1).ToArray();
|
||
}
|
||
else
|
||
{
|
||
text = array2[0].Trim();
|
||
text2 = array2[1].Trim();
|
||
array3 = array2.Skip(2).ToArray();
|
||
}
|
||
}
|
||
else
|
||
{
|
||
array3 = new string[0];
|
||
}
|
||
string[] array4 = array3;
|
||
foreach (string text4 in array4)
|
||
{
|
||
if (list2.Where((string c) => c == item.Trim()).Count() == 0)
|
||
{
|
||
list2.Add(text4.Trim());
|
||
num++;
|
||
ListViewItem listViewItem = new ListViewItem(num.ToString());
|
||
listViewItem.SubItems.Add(text.Trim());
|
||
listViewItem.SubItems.Add(text2.Trim());
|
||
listViewItem.SubItems.Add(text4.Trim());
|
||
listViewItem.SubItems.Add("0");
|
||
listViewItem.SubItems.Add("-");
|
||
listViewItem.SubItems.Add("-");
|
||
listViewItem.SubItems.Add("");
|
||
listViewItem.UseItemStyleForSubItems = false;
|
||
listcycleRedeemIdList.Items.Add(listViewItem);
|
||
}
|
||
}
|
||
}
|
||
num2++;
|
||
}
|
||
MessageBox.Show("账号输入格式不正确,请在中间账号输入框,输入账号");
|
||
}
|
||
|
||
private void button2_Click(object sender, EventArgs e)
|
||
{
|
||
if (MessageBox.Show("确认删除列表数据吗", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
|
||
{
|
||
listcycleRedeemIdList.Items.Clear();
|
||
}
|
||
}
|
||
|
||
private void button1_Click_1(object sender, EventArgs e)
|
||
{
|
||
ExperList(listcycleRedeemIdList);
|
||
}
|
||
|
||
private void btnStartRedeem_Click(object sender, EventArgs e)
|
||
{
|
||
if (float.TryParse(txtSepTime.Text, out var result))
|
||
{
|
||
if (result > 0f)
|
||
{
|
||
if (!isStartRun)
|
||
{
|
||
StartTime(result);
|
||
return;
|
||
}
|
||
expirationExecuted = false;
|
||
isStartRun = false;
|
||
CycleReddemTask.Instance.Stop();
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入分钟");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MessageBox.Show("请输入正确数值分钟");
|
||
}
|
||
}
|
||
|
||
public async void StartTime(float timeMinute)
|
||
{
|
||
ConfigUtlis.saveConfigKey("ckCycleReddenVpn", ckCycleReddenVpn.Checked.ToString());
|
||
ConfigUtlis.saveConfigKey("ckCycleRemoteReddem", ckCycleRemoteReddem.Checked.ToString());
|
||
ConfigUtlis.saveConfigKey("ckcycleSingleProcessRedeem", ckcycleSingleProcessRedeem.Checked.ToString());
|
||
ConfigUtlis.saveConfigKey("txtCycleLoadAccount", txtCycleLoadAccount.Text.ToString());
|
||
isStartRun = true;
|
||
btnStartRedeem.Text = "停止";
|
||
btnStartRedeem.ForeColor = Color.Red;
|
||
expirationTime = DateTime.Now.AddMinutes(timeMinute);
|
||
await Task.Run(delegate
|
||
{
|
||
do
|
||
{
|
||
if (!(DateTime.Now >= expirationTime))
|
||
{
|
||
UpdateCountdownTime();
|
||
}
|
||
else if (!expirationExecuted)
|
||
{
|
||
if (!CycleReddemTask.Instance.TaskIsRun)
|
||
{
|
||
expirationExecuted = true;
|
||
UpdataMainUi(delegate
|
||
{
|
||
btnExecuted_Click(null, null);
|
||
label7.Text = "正在执行兑换...";
|
||
});
|
||
}
|
||
else
|
||
{
|
||
UpdataMainUi(delegate
|
||
{
|
||
label7.Text = "等待兑换...";
|
||
});
|
||
}
|
||
}
|
||
else
|
||
{
|
||
UpdataMainUi(delegate
|
||
{
|
||
label7.Text = "正在执行兑换...";
|
||
});
|
||
if (!CycleReddemTask.Instance.TaskIsRun)
|
||
{
|
||
expirationTime = DateTime.Now.AddMinutes(timeMinute);
|
||
expirationExecuted = false;
|
||
}
|
||
}
|
||
Task.Delay(500).Wait();
|
||
}
|
||
while (isStartRun);
|
||
});
|
||
btnStartRedeem.Text = "开始启动兑换";
|
||
btnStartRedeem.ForeColor = Color.Green;
|
||
label7.Text = "未开始";
|
||
isStartRun = false;
|
||
}
|
||
|
||
public void UpdateCountdownTime()
|
||
{
|
||
TimeSpan timeSpan = expirationTime - DateTime.Now;
|
||
UpdataMainUi(delegate
|
||
{
|
||
label7.Text = (int)timeSpan.TotalMinutes + "分" + timeSpan.Seconds + "秒";
|
||
});
|
||
}
|
||
|
||
public void plaYpromptTone()
|
||
{
|
||
try
|
||
{
|
||
sp.Stop();
|
||
sp.Play();
|
||
UpdataMainUi(delegate
|
||
{
|
||
FlashWin();
|
||
});
|
||
}
|
||
catch (Exception)
|
||
{
|
||
}
|
||
}
|
||
|
||
[DllImport("User32.dll", CharSet = CharSet.Unicode)]
|
||
private static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
|
||
|
||
private void FlashWin()
|
||
{
|
||
FLASHWINFO pwfi = default(FLASHWINFO);
|
||
pwfi.cbSize = Convert.ToUInt32(Marshal.SizeOf((object)pwfi));
|
||
pwfi.hwnd = base.Handle;
|
||
pwfi.dwFlags = 6u;
|
||
pwfi.uCount = 5u;
|
||
pwfi.dwTimeout = 500u;
|
||
FlashWindowEx(ref pwfi);
|
||
}
|
||
|
||
public void UpdataMainUi(Action act)
|
||
{
|
||
try
|
||
{
|
||
if (!base.IsDisposed && base.IsHandleCreated)
|
||
{
|
||
Invoke(act);
|
||
}
|
||
}
|
||
catch (Exception)
|
||
{
|
||
}
|
||
}
|
||
|
||
private void btnStopRemovePay_Click(object sender, EventArgs e)
|
||
{
|
||
FromDBDataQuery fromDBDataQuery = new FromDBDataQuery();
|
||
fromDBDataQuery.sqlTitle = new Dictionary<string, string>
|
||
{
|
||
{ "value3", "卡片代码|150" },
|
||
{ "value1", "账号|150" },
|
||
{ "value2", "密码|100" },
|
||
{ "value4", "兑换次数|80" },
|
||
{ "value5", "更新时间|150" },
|
||
{ "value6", "信息|150" }
|
||
};
|
||
fromDBDataQuery.type = "cycleReddem";
|
||
fromDBDataQuery.typeName = "循环卡片兑换记录";
|
||
fromDBDataQuery.Show();
|
||
}
|
||
|
||
public void applyRedeem(List<AppleAcount> lvItems)
|
||
{
|
||
btnExecuted.Enabled = false;
|
||
CycleReddemTask.Instance.AppleCycleReddemTask(2, lvItems, ckCycleReddenVpn.Checked, ckCycleRemoteReddem.Checked, ckcycleSingleProcessRedeem.Checked, delegate
|
||
{
|
||
if (!base.IsDisposed)
|
||
{
|
||
Invoke((Action)delegate
|
||
{
|
||
btnExecuted.Enabled = false;
|
||
});
|
||
}
|
||
}, delegate
|
||
{
|
||
if (!base.IsDisposed)
|
||
{
|
||
Invoke((Action)delegate
|
||
{
|
||
btnExecuted.Enabled = true;
|
||
});
|
||
}
|
||
}, delegate(string creadNo, string appleid)
|
||
{
|
||
UpdataMainUi(delegate
|
||
{
|
||
ListViewItem listViewItem = (from ListViewItem c in listcycleRedeemIdList.Items
|
||
where c.SubItems[3].Text == creadNo && c.SubItems[1].Text == appleid
|
||
select c).FirstOrDefault();
|
||
if (listViewItem != null)
|
||
{
|
||
SqliteHelper.ExecuteInsert("itunes_db", new Dictionary<string, string>
|
||
{
|
||
{ "type", "cycleReddem" },
|
||
{
|
||
"addTime",
|
||
Tools.GenerateTimeStamp().ToString()
|
||
},
|
||
{
|
||
"value1",
|
||
listViewItem.SubItems[1].Text
|
||
},
|
||
{
|
||
"value2",
|
||
listViewItem.SubItems[2].Text
|
||
},
|
||
{
|
||
"value3",
|
||
listViewItem.SubItems[3].Text
|
||
},
|
||
{
|
||
"value4",
|
||
listViewItem.SubItems[4].Text
|
||
},
|
||
{
|
||
"value5",
|
||
listViewItem.SubItems[6].Text
|
||
},
|
||
{
|
||
"value6",
|
||
listViewItem.SubItems[7].Text
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}, delegate(string creadNo, DisplyType ditype, string distReust)
|
||
{
|
||
UpdataMainUi(delegate
|
||
{
|
||
IEnumerable<ListViewItem> enumerable2 = from ListViewItem c in listcycleRedeemIdList.Items
|
||
where c.SubItems[3].Text == creadNo
|
||
select c;
|
||
new Font(Font, FontStyle.Bold);
|
||
foreach (ListViewItem item in enumerable2)
|
||
{
|
||
switch (ditype)
|
||
{
|
||
case DisplyType.chongzhi:
|
||
item.SubItems[5].Text = "";
|
||
item.SubItems[5].ForeColor = Color.Black;
|
||
break;
|
||
case DisplyType.xiaofeiriqiNow:
|
||
item.SubItems[5].Text = "-";
|
||
break;
|
||
case DisplyType.xinxi:
|
||
item.SubItems[7].Text = distReust;
|
||
break;
|
||
}
|
||
}
|
||
});
|
||
}, delegate(string creadNo, DisplyType ditype, string appleReust)
|
||
{
|
||
if (!base.IsDisposed)
|
||
{
|
||
Invoke((Action)delegate
|
||
{
|
||
IEnumerable<ListViewItem> enumerable = from ListViewItem c in listcycleRedeemIdList.Items
|
||
where c.SubItems[3].Text == creadNo
|
||
select c;
|
||
Font font = new Font(Font, FontStyle.Bold);
|
||
foreach (ListViewItem item2 in enumerable)
|
||
{
|
||
item2.SubItems[6].Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||
if (int.TryParse(item2.SubItems[4].Text, out var result))
|
||
{
|
||
item2.SubItems[4].Text = (result + 1).ToString();
|
||
}
|
||
else
|
||
{
|
||
item2.SubItems[4].Text = "1";
|
||
}
|
||
switch (ditype)
|
||
{
|
||
case DisplyType.reddemLose:
|
||
item2.SubItems[5].Text = appleReust;
|
||
item2.SubItems[5].ForeColor = Color.Red;
|
||
item2.SubItems[5].Font = font;
|
||
break;
|
||
case DisplyType.reddemValid:
|
||
item2.SubItems[5].Text = appleReust;
|
||
item2.SubItems[5].ForeColor = Color.Green;
|
||
item2.SubItems[5].Font = font;
|
||
if (appleReust.Contains("完成") && checkBox2.Checked)
|
||
{
|
||
plaYpromptTone();
|
||
}
|
||
break;
|
||
case DisplyType.reddemUNlock:
|
||
item2.SubItems[5].Text = appleReust;
|
||
item2.SubItems[5].Font = font;
|
||
break;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
|
||
private void btnExecuted_Click(object sender, EventArgs e)
|
||
{
|
||
IEnumerable<ListViewItem> enumerable = from ListViewItem c in listcycleRedeemIdList.Items
|
||
where c.SubItems[5].Text != "停止" && c.SubItems[5].Text != "完成"
|
||
select c;
|
||
foreach (ListViewItem item in enumerable)
|
||
{
|
||
item.SubItems[5].Text = "-";
|
||
}
|
||
List<AppleAcount> lvItems = enumerable.Select((ListViewItem c) => new AppleAcount
|
||
{
|
||
reddemCode = c.SubItems[3].Text,
|
||
appleId = c.SubItems[1].Text,
|
||
applePwd = c.SubItems[2].Text,
|
||
overflow = c.SubItems[4].Text
|
||
}).ToList();
|
||
applyRedeem(lvItems);
|
||
}
|
||
|
||
private void FormIntervalRedeem_FormClosing(object sender, FormClosingEventArgs e)
|
||
{
|
||
if ((CycleReddemTask.Instance.TaskIsRun || isStartRun) && MessageBox.Show("该任务在运行,确定退出吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
|
||
{
|
||
e.Cancel = true;
|
||
return;
|
||
}
|
||
CycleReddemTask.Instance.TaskIsRun = false;
|
||
CycleReddemTask.Instance.Stop();
|
||
}
|
||
|
||
protected override void Dispose(bool disposing)
|
||
{
|
||
if (disposing && components != null)
|
||
{
|
||
components.Dispose();
|
||
}
|
||
base.Dispose(disposing);
|
||
}
|
||
|
||
private void InitializeComponent()
|
||
{
|
||
this.listcycleRedeemIdList = new System.Windows.Forms.ListView();
|
||
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader11 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
|
||
this.columnHeader10 = new System.Windows.Forms.ColumnHeader();
|
||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||
this.btnExecuted = new System.Windows.Forms.Button();
|
||
this.label7 = new System.Windows.Forms.Label();
|
||
this.label4 = new System.Windows.Forms.Label();
|
||
this.label3 = new System.Windows.Forms.Label();
|
||
this.txtSepTime = new System.Windows.Forms.TextBox();
|
||
this.label2 = new System.Windows.Forms.Label();
|
||
this.label1 = new System.Windows.Forms.Label();
|
||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||
this.ckCycleReddenVpn = new System.Windows.Forms.CheckBox();
|
||
this.ckcycleSingleProcessRedeem = new System.Windows.Forms.CheckBox();
|
||
this.ckCycleRemoteReddem = new System.Windows.Forms.CheckBox();
|
||
this.btnStartRedeem = new System.Windows.Forms.Button();
|
||
this.btnTestAccount = new System.Windows.Forms.Button();
|
||
this.label45 = new System.Windows.Forms.Label();
|
||
this.txtCycleLoadAccount = new System.Windows.Forms.TextBox();
|
||
this.btnReddenInput = new System.Windows.Forms.Button();
|
||
this.button1 = new System.Windows.Forms.Button();
|
||
this.btnStopRemovePay = new System.Windows.Forms.Button();
|
||
this.button2 = new System.Windows.Forms.Button();
|
||
this.labCheckAcountMsg = new System.Windows.Forms.Label();
|
||
this.labTestDianshu = new System.Windows.Forms.Label();
|
||
this.label47 = new System.Windows.Forms.Label();
|
||
this.label14 = new System.Windows.Forms.Label();
|
||
this.groupBox1.SuspendLayout();
|
||
base.SuspendLayout();
|
||
this.listcycleRedeemIdList.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||
this.listcycleRedeemIdList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[8] { this.columnHeader1, this.columnHeader2, this.columnHeader4, this.columnHeader11, this.columnHeader5, this.columnHeader3, this.columnHeader6, this.columnHeader10 });
|
||
this.listcycleRedeemIdList.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.listcycleRedeemIdList.FullRowSelect = true;
|
||
this.listcycleRedeemIdList.HideSelection = false;
|
||
this.listcycleRedeemIdList.Location = new System.Drawing.Point(12, 209);
|
||
this.listcycleRedeemIdList.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.listcycleRedeemIdList.Name = "listcycleRedeemIdList";
|
||
this.listcycleRedeemIdList.Size = new System.Drawing.Size(941, 434);
|
||
this.listcycleRedeemIdList.TabIndex = 0;
|
||
this.listcycleRedeemIdList.UseCompatibleStateImageBehavior = false;
|
||
this.listcycleRedeemIdList.View = System.Windows.Forms.View.Details;
|
||
this.listcycleRedeemIdList.MouseClick += new System.Windows.Forms.MouseEventHandler(listIntervalRedeemIdList_MouseClick);
|
||
this.columnHeader1.Text = "序号";
|
||
this.columnHeader1.Width = 40;
|
||
this.columnHeader2.Text = "账号";
|
||
this.columnHeader2.Width = 150;
|
||
this.columnHeader4.Text = "密码";
|
||
this.columnHeader4.Width = 100;
|
||
this.columnHeader11.Text = "礼品卡代码";
|
||
this.columnHeader11.Width = 150;
|
||
this.columnHeader5.Text = "次数";
|
||
this.columnHeader5.Width = 50;
|
||
this.columnHeader3.Text = "状态";
|
||
this.columnHeader3.Width = 50;
|
||
this.columnHeader6.Text = "最近更新时间";
|
||
this.columnHeader6.Width = 140;
|
||
this.columnHeader10.Text = "信息";
|
||
this.columnHeader10.Width = 250;
|
||
this.groupBox1.Controls.Add(this.btnExecuted);
|
||
this.groupBox1.Controls.Add(this.label7);
|
||
this.groupBox1.Controls.Add(this.label4);
|
||
this.groupBox1.Controls.Add(this.label3);
|
||
this.groupBox1.Controls.Add(this.txtSepTime);
|
||
this.groupBox1.Controls.Add(this.label2);
|
||
this.groupBox1.Controls.Add(this.label1);
|
||
this.groupBox1.Controls.Add(this.checkBox2);
|
||
this.groupBox1.Controls.Add(this.ckCycleReddenVpn);
|
||
this.groupBox1.Controls.Add(this.ckcycleSingleProcessRedeem);
|
||
this.groupBox1.Controls.Add(this.ckCycleRemoteReddem);
|
||
this.groupBox1.Controls.Add(this.btnStartRedeem);
|
||
this.groupBox1.Location = new System.Drawing.Point(16, 12);
|
||
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.groupBox1.Name = "groupBox1";
|
||
this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.groupBox1.Size = new System.Drawing.Size(936, 99);
|
||
this.groupBox1.TabIndex = 4;
|
||
this.groupBox1.TabStop = false;
|
||
this.groupBox1.Text = "配置";
|
||
this.btnExecuted.ForeColor = System.Drawing.Color.Firebrick;
|
||
this.btnExecuted.Location = new System.Drawing.Point(398, 60);
|
||
this.btnExecuted.Name = "btnExecuted";
|
||
this.btnExecuted.Size = new System.Drawing.Size(69, 24);
|
||
this.btnExecuted.TabIndex = 38;
|
||
this.btnExecuted.Text = "直接执行";
|
||
this.btnExecuted.UseVisualStyleBackColor = true;
|
||
this.btnExecuted.Click += new System.EventHandler(btnExecuted_Click);
|
||
this.label7.AutoSize = true;
|
||
this.label7.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.label7.ForeColor = System.Drawing.Color.Green;
|
||
this.label7.Location = new System.Drawing.Point(289, 64);
|
||
this.label7.Name = "label7";
|
||
this.label7.Size = new System.Drawing.Size(52, 14);
|
||
this.label7.TabIndex = 37;
|
||
this.label7.Text = "未开始";
|
||
this.label4.AutoSize = true;
|
||
this.label4.Location = new System.Drawing.Point(203, 64);
|
||
this.label4.Name = "label4";
|
||
this.label4.Size = new System.Drawing.Size(80, 17);
|
||
this.label4.TabIndex = 36;
|
||
this.label4.Text = "执行倒计时:";
|
||
this.label3.AutoSize = true;
|
||
this.label3.Location = new System.Drawing.Point(332, 28);
|
||
this.label3.Name = "label3";
|
||
this.label3.Size = new System.Drawing.Size(32, 17);
|
||
this.label3.TabIndex = 35;
|
||
this.label3.Text = "分钟";
|
||
this.txtSepTime.Location = new System.Drawing.Point(268, 25);
|
||
this.txtSepTime.Name = "txtSepTime";
|
||
this.txtSepTime.Size = new System.Drawing.Size(58, 23);
|
||
this.txtSepTime.TabIndex = 34;
|
||
this.txtSepTime.Text = "10";
|
||
this.label2.AutoSize = true;
|
||
this.label2.Location = new System.Drawing.Point(203, 29);
|
||
this.label2.Name = "label2";
|
||
this.label2.Size = new System.Drawing.Size(59, 17);
|
||
this.label2.TabIndex = 33;
|
||
this.label2.Text = "间隔时间:";
|
||
this.label1.AutoSize = true;
|
||
this.label1.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.label1.ForeColor = System.Drawing.SystemColors.Highlight;
|
||
this.label1.Location = new System.Drawing.Point(509, 69);
|
||
this.label1.Name = "label1";
|
||
this.label1.Size = new System.Drawing.Size(335, 17);
|
||
this.label1.TabIndex = 32;
|
||
this.label1.Text = "因现在苹果加卡限制,请一个ID对应5张卡,间隔要超过1分钟";
|
||
this.checkBox2.AutoSize = true;
|
||
this.checkBox2.Checked = true;
|
||
this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked;
|
||
this.checkBox2.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.checkBox2.Location = new System.Drawing.Point(515, 18);
|
||
this.checkBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.checkBox2.Name = "checkBox2";
|
||
this.checkBox2.Size = new System.Drawing.Size(108, 16);
|
||
this.checkBox2.TabIndex = 31;
|
||
this.checkBox2.Text = "兑换成功提示音";
|
||
this.checkBox2.UseVisualStyleBackColor = true;
|
||
this.ckCycleReddenVpn.AutoSize = true;
|
||
this.ckCycleReddenVpn.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.ckCycleReddenVpn.ForeColor = System.Drawing.Color.Red;
|
||
this.ckCycleReddenVpn.Location = new System.Drawing.Point(512, 44);
|
||
this.ckCycleReddenVpn.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.ckCycleReddenVpn.Name = "ckCycleReddenVpn";
|
||
this.ckCycleReddenVpn.Size = new System.Drawing.Size(111, 21);
|
||
this.ckCycleReddenVpn.TabIndex = 30;
|
||
this.ckCycleReddenVpn.Text = "使用随机IP代理";
|
||
this.ckCycleReddenVpn.UseVisualStyleBackColor = true;
|
||
this.ckcycleSingleProcessRedeem.AutoSize = true;
|
||
this.ckcycleSingleProcessRedeem.Checked = true;
|
||
this.ckcycleSingleProcessRedeem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||
this.ckcycleSingleProcessRedeem.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.ckcycleSingleProcessRedeem.ForeColor = System.Drawing.Color.MediumBlue;
|
||
this.ckcycleSingleProcessRedeem.Location = new System.Drawing.Point(759, 45);
|
||
this.ckcycleSingleProcessRedeem.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.ckcycleSingleProcessRedeem.Name = "ckcycleSingleProcessRedeem";
|
||
this.ckcycleSingleProcessRedeem.Size = new System.Drawing.Size(137, 21);
|
||
this.ckcycleSingleProcessRedeem.TabIndex = 29;
|
||
this.ckcycleSingleProcessRedeem.Text = "相同ID以单线程兑换";
|
||
this.ckcycleSingleProcessRedeem.UseVisualStyleBackColor = true;
|
||
this.ckCycleRemoteReddem.AutoSize = true;
|
||
this.ckCycleRemoteReddem.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.ckCycleRemoteReddem.ForeColor = System.Drawing.Color.Green;
|
||
this.ckCycleRemoteReddem.Location = new System.Drawing.Point(647, 45);
|
||
this.ckCycleRemoteReddem.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.ckCycleRemoteReddem.Name = "ckCycleRemoteReddem";
|
||
this.ckCycleRemoteReddem.Size = new System.Drawing.Size(99, 21);
|
||
this.ckCycleRemoteReddem.TabIndex = 28;
|
||
this.ckCycleRemoteReddem.Text = "使用远程网络";
|
||
this.ckCycleRemoteReddem.UseVisualStyleBackColor = true;
|
||
this.btnStartRedeem.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.btnStartRedeem.ForeColor = System.Drawing.Color.Green;
|
||
this.btnStartRedeem.Location = new System.Drawing.Point(19, 29);
|
||
this.btnStartRedeem.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
this.btnStartRedeem.Name = "btnStartRedeem";
|
||
this.btnStartRedeem.Size = new System.Drawing.Size(164, 49);
|
||
this.btnStartRedeem.TabIndex = 1;
|
||
this.btnStartRedeem.Text = "开始启动兑换";
|
||
this.btnStartRedeem.UseVisualStyleBackColor = true;
|
||
this.btnStartRedeem.Click += new System.EventHandler(btnStartRedeem_Click);
|
||
this.btnTestAccount.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.btnTestAccount.Location = new System.Drawing.Point(536, 157);
|
||
this.btnTestAccount.Name = "btnTestAccount";
|
||
this.btnTestAccount.Size = new System.Drawing.Size(111, 23);
|
||
this.btnTestAccount.TabIndex = 21;
|
||
this.btnTestAccount.Text = "测试账号状态";
|
||
this.btnTestAccount.UseVisualStyleBackColor = true;
|
||
this.btnTestAccount.Click += new System.EventHandler(btnTestAccount_Click);
|
||
this.label45.AutoSize = true;
|
||
this.label45.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.label45.ForeColor = System.Drawing.Color.Firebrick;
|
||
this.label45.Location = new System.Drawing.Point(23, 161);
|
||
this.label45.Name = "label45";
|
||
this.label45.Size = new System.Drawing.Size(90, 17);
|
||
this.label45.TabIndex = 20;
|
||
this.label45.Text = "加载Apple账号";
|
||
this.txtCycleLoadAccount.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.txtCycleLoadAccount.Location = new System.Drawing.Point(125, 157);
|
||
this.txtCycleLoadAccount.Name = "txtCycleLoadAccount";
|
||
this.txtCycleLoadAccount.Size = new System.Drawing.Size(405, 23);
|
||
this.txtCycleLoadAccount.TabIndex = 19;
|
||
this.txtCycleLoadAccount.Text = "账号输入格式:xxxx@xxx.com----密码";
|
||
this.txtCycleLoadAccount.Enter += new System.EventHandler(txtCycleLoadAccount_Enter);
|
||
this.txtCycleLoadAccount.Leave += new System.EventHandler(txtCycleLoadAccount_Leave);
|
||
this.btnReddenInput.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.btnReddenInput.Location = new System.Drawing.Point(35, 119);
|
||
this.btnReddenInput.Name = "btnReddenInput";
|
||
this.btnReddenInput.Size = new System.Drawing.Size(133, 32);
|
||
this.btnReddenInput.TabIndex = 22;
|
||
this.btnReddenInput.Text = "卡片代码输入";
|
||
this.btnReddenInput.UseVisualStyleBackColor = true;
|
||
this.btnReddenInput.Click += new System.EventHandler(btnReddenInput_Click);
|
||
this.button1.Location = new System.Drawing.Point(311, 123);
|
||
this.button1.Name = "button1";
|
||
this.button1.Size = new System.Drawing.Size(130, 24);
|
||
this.button1.TabIndex = 24;
|
||
this.button1.Text = "导出记录";
|
||
this.button1.UseVisualStyleBackColor = true;
|
||
this.button1.Click += new System.EventHandler(button1_Click_1);
|
||
this.btnStopRemovePay.Location = new System.Drawing.Point(175, 123);
|
||
this.btnStopRemovePay.Name = "btnStopRemovePay";
|
||
this.btnStopRemovePay.Size = new System.Drawing.Size(130, 24);
|
||
this.btnStopRemovePay.TabIndex = 23;
|
||
this.btnStopRemovePay.Text = "循环兑换纪录查询";
|
||
this.btnStopRemovePay.UseVisualStyleBackColor = true;
|
||
this.btnStopRemovePay.Click += new System.EventHandler(btnStopRemovePay_Click);
|
||
this.button2.Location = new System.Drawing.Point(877, 179);
|
||
this.button2.Name = "button2";
|
||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||
this.button2.TabIndex = 55;
|
||
this.button2.Text = "清空列表";
|
||
this.button2.UseVisualStyleBackColor = true;
|
||
this.button2.Click += new System.EventHandler(button2_Click);
|
||
this.labCheckAcountMsg.AutoSize = true;
|
||
this.labCheckAcountMsg.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.labCheckAcountMsg.Location = new System.Drawing.Point(127, 187);
|
||
this.labCheckAcountMsg.Name = "labCheckAcountMsg";
|
||
this.labCheckAcountMsg.Size = new System.Drawing.Size(0, 17);
|
||
this.labCheckAcountMsg.TabIndex = 56;
|
||
this.labTestDianshu.AutoSize = true;
|
||
this.labTestDianshu.Font = new System.Drawing.Font("微软雅黑", 10.5f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.labTestDianshu.ForeColor = System.Drawing.Color.Crimson;
|
||
this.labTestDianshu.Location = new System.Drawing.Point(775, 156);
|
||
this.labTestDianshu.Name = "labTestDianshu";
|
||
this.labTestDianshu.Size = new System.Drawing.Size(18, 19);
|
||
this.labTestDianshu.TabIndex = 57;
|
||
this.labTestDianshu.Text = "0";
|
||
this.label47.AutoSize = true;
|
||
this.label47.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
this.label47.Location = new System.Drawing.Point(653, 158);
|
||
this.label47.Name = "label47";
|
||
this.label47.Size = new System.Drawing.Size(116, 17);
|
||
this.label47.TabIndex = 58;
|
||
this.label47.Text = "测试账号消耗点数:";
|
||
this.label14.AutoSize = true;
|
||
this.label14.Location = new System.Drawing.Point(447, 126);
|
||
this.label14.Name = "label14";
|
||
this.label14.Size = new System.Drawing.Size(452, 17);
|
||
this.label14.TabIndex = 62;
|
||
this.label14.Text = "循环兑换时:第一次兑换扣10点,第二次以后兑换失败扣3点,加载成功ID扣:50点";
|
||
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
|
||
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||
base.ClientSize = new System.Drawing.Size(964, 656);
|
||
base.Controls.Add(this.label14);
|
||
base.Controls.Add(this.labTestDianshu);
|
||
base.Controls.Add(this.label47);
|
||
base.Controls.Add(this.labCheckAcountMsg);
|
||
base.Controls.Add(this.button2);
|
||
base.Controls.Add(this.button1);
|
||
base.Controls.Add(this.btnStopRemovePay);
|
||
base.Controls.Add(this.btnReddenInput);
|
||
base.Controls.Add(this.btnTestAccount);
|
||
base.Controls.Add(this.label45);
|
||
base.Controls.Add(this.txtCycleLoadAccount);
|
||
base.Controls.Add(this.groupBox1);
|
||
base.Controls.Add(this.listcycleRedeemIdList);
|
||
this.Font = new System.Drawing.Font("微软雅黑", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||
base.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||
base.MaximizeBox = false;
|
||
base.Name = "FormIntervalRedeem";
|
||
base.ShowIcon = false;
|
||
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||
this.Text = "批量间隔循环兑换礼品卡";
|
||
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormIntervalRedeem_FormClosing);
|
||
base.Load += new System.EventHandler(FormIntervalRedeem_Load);
|
||
this.groupBox1.ResumeLayout(false);
|
||
this.groupBox1.PerformLayout();
|
||
base.ResumeLayout(false);
|
||
base.PerformLayout();
|
||
}
|
||
}
|
||
}
|