async void InitLogin() { if (settings.loginDatas != null && settings.loginDatas.Count > 0) { ld = new LoadingWindow(); ld.Show(); ld.SetTitle("登陆中"); ld.SetTip("正在登陆"); ld.SetPgr(0, settings.loginDatas.Count); for (int i = 0; i < settings.loginDatas.Count; i++) { var t = settings.loginDatas[i]; ld.SetPgr(i, settings.loginDatas.Count); ld.SetTip("正在登陆账号:" + t.phone); await UserLogin(t); } chk_autoRefresh.IsChecked = settings.autoRefresh; LoadAccounts(); await RefreshStatus(); ld.Close(); ld = null; StatusTimer.Start(); } }
async Task RefreshStatus() { if (ApiHelper.userBasicDatas.Count == 0) { deviceInfos = null; lv_DeviceStatus.ItemsSource = deviceInfos; AutoHeaderWidth(lv_DeviceStatus); return; } for (int i = 0; i < ApiHelper.userBasicDatas.Count; i++) { var t = ApiHelper.userBasicDatas.ElementAt(i); var phone = t.Key; var basic = t.Value; if (ld != null) { ld.SetTitle($"正在获取数据"); ld.SetPgr(i, ApiHelper.userBasicDatas.Count); ld.SetTip($"正在获取账号{phone}的数据"); } if (await ListPeer(phone)) { if (await GetUserInfo(phone)) { await GetIncomeHistory(phone); await GetWkbAccountInfo(phone); await GetUsbInfo(phone); } } deviceInfos = null; lv_DeviceStatus.ItemsSource = deviceInfos; AutoHeaderWidth(lv_DeviceStatus); } }
private async void btu_tibi_Click(object sender, RoutedEventArgs e) { //MessageBox.Show("请等待接下来的开发和更新", "提示"); LoadingWindow wkld = new LoadingWindow(); wkld.SetTitle("正在提取玩客币"); wkld.Show(); string result = ""; for (int i = 0; i < settings.loginDatas.Count; i++) { var t = settings.loginDatas[i]; wkld.SetTip($"正在提取账号{t.phone}的玩客币"); wkld.SetPgr(i, settings.loginDatas.Count); string tresult = ""; var r = await DrawWkb(t.phone); if (r != null) { tresult = $"{t.phone}:({r.iRet}){r.sMsg}"; } else { tresult = $"{t.phone}:网络通讯失败"; } if (i != settings.loginDatas.Count - 1) { result += tresult + Environment.NewLine; } else { result += tresult; } } wkld.Close(); MessageBox.Show(result, "提币结果"); }