private bool FreshQuick(ref _GoodsFreshStr goodInfo, GoodsFresh objFresh) { string strError = ""; if (string.IsNullOrEmpty(goodInfo.strLastFreshQuickTime)) { goodInfo.strLastFreshQuickTime = "未知"; } //得到还有的次数显示 goodInfo.strQuickFreshTimeLeft = "未知"; goodInfo.strFreshStatus = "正在登录..."; ShowInfo(goodInfo); bool bRet = objFresh.Login(goodInfo.strAcc, goodInfo.strPwd,true); if (!bRet) { strError = "登录失败"; goodInfo.strFreshStatus = strError; return false; } goodInfo.strFreshStatus = "正在刷新..."; ShowInfo(goodInfo); string strLeft = ""; int iRet = objFresh.FreshQuick(out strError, out strLeft); if (iRet != 0) { goodInfo.strFreshStatus = strError; if (strError == "您今天的刷新次数已用完" || strError == "没有一键刷新权限") { goodInfo.strQuickFreshTimeLeft = "0"; } ShowInfo(goodInfo); return false; } //写入配置文件 goodInfo.strLastFreshQuickTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //得到还有的次数显示 goodInfo.strQuickFreshTimeLeft = strLeft; ShowInfo(goodInfo); IniUtility.WriteIniKey("set", goodInfo.strAcc + "_lastFreshTime", goodInfo.strLastFreshQuickTime); return true; }
private void button1_Click(object sender, EventArgs e) { // _GoodsFreshStr objInfoEx = new _GoodsFreshStr(); //objInfoEx.strAcc = "aaa"; TestStr1 bulder = new TestStr1(); bulder.strAcc = "AAA"; Hashtable tblHash = new Hashtable(); bulder.strAcc = "AAABBB"; _GoodsFreshStr objInfoExEx = new _GoodsFreshStr(); string strDirectoryXls = System.AppDomain.CurrentDomain.BaseDirectory + "xlsfile"; SaveToExcel(strDirectoryXls, null, "aaaaa"); return; GoodsFresh objFreshEx = new GoodsFresh(); ClassHttpPost webPost = new ClassHttpPost(); objFreshEx.SetWebPost(webPost); string strDirect = System.AppDomain.CurrentDomain.BaseDirectory + "pic"; if (!Directory.Exists(strDirect)) { Directory.CreateDirectory(strDirect); } return; //string str = System.Web.HttpUtility.UrlEncode("你好", Encoding.GetEncoding("gb2312")); string str = string.Format("{0} {1}", 519.0, 535.01); MessageBox.Show(str); return; TimerFunction(); return; string strAcc = "heilongjiangjt"; _GoodsFreshStr objInfo = new _GoodsFreshStr(); DataContrl.GetDataCache(strAcc, ref objInfo); MessageBox.Show(objInfo.iFreshCount.ToString()); objInfo.iFreshCount = 2; //DataContrl.InitFreshTime(); DataContrl.GetDataCache(strAcc, ref objInfo); MessageBox.Show(objInfo.iFreshCount.ToString()); return; IsSetIllegal(); return; _GoodsFreshStr goodInfo = new _GoodsFreshStr(); bool bRet = DataContrl.GetDataCache("heilongjiangjt", ref goodInfo); if (!bRet) { return; } GoodsFresh objFresh = new GoodsFresh(); objFresh.SetWebPost(goodInfo.webPost); bRet = objFresh.Login(goodInfo.strAcc, goodInfo.strPwd,true); string strError = ""; objFresh.FreshQuick(out strError,out strError); }
private void button1_Click(object sender, EventArgs e) { // _GoodsFreshStr objInfoEx = new _GoodsFreshStr(); //objInfoEx.strAcc = "aaa"; TestStr1 bulder = new TestStr1(); bulder.strAcc = "AAA"; Hashtable tblHash = new Hashtable(); bulder.strAcc = "AAABBB"; _GoodsFreshStr objInfoExEx = new _GoodsFreshStr(); string strDirectoryXls = System.AppDomain.CurrentDomain.BaseDirectory + "xlsfile"; SaveToExcel(strDirectoryXls, null, "aaaaa"); return; GoodsFresh objFreshEx = new GoodsFresh(); ClassHttpPost webPost = new ClassHttpPost(); objFreshEx.SetWebPost(webPost); string strDirect = System.AppDomain.CurrentDomain.BaseDirectory + "pic"; if (!Directory.Exists(strDirect)) { Directory.CreateDirectory(strDirect); } return; //string str = System.Web.HttpUtility.UrlEncode("你好", Encoding.GetEncoding("gb2312")); string str = string.Format("{0} {1}", 519.0, 535.01); MessageBox.Show(str); return; TimerFunction(); return; string strAcc = "heilongjiangjt"; _GoodsFreshStr objInfo = new _GoodsFreshStr(); DataContrl.GetDataCache(strAcc, ref objInfo); MessageBox.Show(objInfo.iFreshCount.ToString()); objInfo.iFreshCount = 2; //DataContrl.InitFreshTime(); DataContrl.GetDataCache(strAcc, ref objInfo); MessageBox.Show(objInfo.iFreshCount.ToString()); return; IsSetIllegal(); return; _GoodsFreshStr goodInfo = new _GoodsFreshStr(); bool bRet = DataContrl.GetDataCache("heilongjiangjt", ref goodInfo); if (!bRet) { return; } GoodsFresh objFresh = new GoodsFresh(); objFresh.SetWebPost(goodInfo.webPost); bRet = objFresh.Login(goodInfo.strAcc, goodInfo.strPwd, true); string strError = ""; objFresh.FreshQuick(out strError, out strError); }