WebHelper.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. using BizCom;
  2. using Newtonsoft.Json;
  3. using Newtonsoft.Json.Linq;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Net;
  7. using System.Net.Sockets;
  8. using System.Reflection;
  9. using System.Runtime.InteropServices;
  10. using System.Text;
  11. using System.Web;
  12. using Utils;
  13. namespace SiteCore
  14. {
  15. public class WebHelper
  16. {
  17. static int exp_page_size = 9999;
  18. public static List<Dictionary<string, object>> getComReportData(string url, string parms)
  19. {
  20. HttpCookie lcCookie = HttpContext.Current.Request.Cookies[webConfig.CookieName];
  21. string name = HttpUtility.UrlDecode(lcCookie.Values["User"]);
  22. string ticket = lcCookie.Values["Ticket"];
  23. if (parms == "") parms = "pageSize=" + exp_page_size;
  24. else parms += "&pageSize=" + exp_page_size;
  25. parms += "&_expt=1";
  26. //parms = HttpUtility.UrlEncode(parms);
  27. HttpHelper http = new HttpHelper();
  28. HttpItem item = new HttpItem()
  29. {
  30. URL = url,
  31. Method = "POST",
  32. ContentType = "application/x-www-form-urlencoded; charset=UTF-8",
  33. Cookie = webConfig.CookieName + "=user=" + name + "&ticket=" + ticket,
  34. Postdata = parms
  35. };
  36. HttpResult hresult = http.GetHtml(item);
  37. string html = hresult.Html;
  38. JObject jobj = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(html);
  39. if (jobj["total"] != null)
  40. {
  41. List<Dictionary<string, object>> lists_sec;
  42. List<Dictionary<string, object>> lists = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(jobj["data"].ToString());
  43. int pg = (Convert.ToInt32(jobj["total"]) - 1) / exp_page_size + 1; // exp_page_size;
  44. if (pg > 1)
  45. {
  46. for (int i = 2; i <= pg; i++)
  47. {
  48. if (i == 2) parms = parms.Replace("pageIndex=0", "pageIndex=" + i);
  49. parms = parms.Replace("pageIndex=" + (i - 1), "pageIndex=" + i);
  50. item = new HttpItem()
  51. {
  52. URL = url,
  53. Method = "POST",
  54. ContentType = "application/x-www-form-urlencoded; charset=UTF-8",
  55. Cookie = webConfig.CookieName + "=user=" + name + "&ticket=" + ticket,
  56. Postdata = parms
  57. };
  58. hresult = http.GetHtml(item);
  59. html = hresult.Html;
  60. jobj = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(html);
  61. if (jobj["total"] != null)
  62. {
  63. lists_sec = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(jobj["data"].ToString());
  64. lists.AddRange(lists_sec);
  65. }
  66. }
  67. }
  68. return lists;
  69. //Hashtable htable= JsonConvert.DeserializeObject<Hashtable>(jobj["data"].ToString());
  70. }
  71. return null;
  72. }
  73. public static object GetReflectionObject(string className)
  74. {
  75. if (string.IsNullOrEmpty(className)) return null;
  76. string tmpName = "BizCom." + className;
  77. return Assembly.Load("BizCom").CreateInstance(tmpName);
  78. }
  79. private static void sendSign(string str, ref StringBuilder sql)
  80. {
  81. if (str != "" && str != "|")
  82. {
  83. List<string> lst = new List<string>();
  84. string[] sArr = str.Split('|');
  85. string[] tArr;
  86. for (int i = 0; i < sArr.Length; i++)
  87. {
  88. tArr = sArr[i].Split(',');
  89. if (tArr.Length < 7 || tArr[6] == "") continue;
  90. //WxPush.sendSignMsg(tArr, lst);
  91. }
  92. if (lst.Count > 0)
  93. {
  94. sql.AppendFormat("delete from S_WxFormId where formids in ({0}) ;", string.Join(",", lst.ToArray()));
  95. }
  96. }
  97. }
  98. private static void sendExpire(string str, ref StringBuilder sql)
  99. {
  100. if (str != "" && str != "|")
  101. {
  102. List<string> lst = new List<string>();
  103. string[] sArr = str.Split('|');
  104. string[] tArr;
  105. for (int i = 0; i < sArr.Length; i++)
  106. {
  107. tArr = sArr[i].Split(',');
  108. if (tArr.Length < 7 || tArr[6] == "") continue;
  109. //WxPush.sendExpireMsg(tArr, lst);
  110. }
  111. if (lst.Count > 0)
  112. {
  113. sql.AppendFormat("delete from S_WxFormId where formids in ({0}) ;", string.Join(",", lst.ToArray()));
  114. }
  115. }
  116. }
  117. /// <summary>
  118. /// 重置密码发送邮件
  119. /// </summary>
  120. /// <param name="to"></param>
  121. /// <param name="userName"></param>
  122. /// <param name="pwd"></param>
  123. /// <param name="errMsg"></param>
  124. /// <returns></returns>
  125. public static bool SendResetPwdMail(string to, string userName, string rkey, out string errMsg)
  126. {
  127. errMsg = "";
  128. StringBuilder str = new StringBuilder();
  129. str.Append("<div style=\"font-size:14px\">");
  130. str.AppendFormat("<div><span style='color:blue'>{0}</span>您好,</div> ", userName);
  131. str.Append("<div style=\"text-indent: 2em\">&nbsp;</div> ");
  132. str.Append("<div style=\"text-indent: 2em\"><b>请点击下面链接进行密码重置:</b></div> ");
  133. str.Append("<div style=\"text-indent: 2em\">&nbsp;</div> ");
  134. //str.AppendFormat("<div style=\"text-indent: 2em\">您在城市便签的密码已经重置为:<strong style=\"color:#ff0000\">{0}</strong>(注意大小写)</div> ", pwd);
  135. //str.Append("<div style=\"text-indent: 2em\">&nbsp;</div> ");
  136. string url = webConfig.SiteUrl + "resetpwd.aspx?acc=" + to + "&key=" + rkey;
  137. str.AppendFormat("<div style=\"text-indent: 2em;font-size:14px;color: #064977;\"><a href=\"{0}\">{0}</a></div>", url);
  138. str.Append("<div align=\"left\">&nbsp;</div> ");
  139. str.Append("<div style=\"text-indent: 2em\"><b>2小时内有效</b></div> ");
  140. str.AppendFormat("<div style=\"text-indent: 2em\"><span><a href=\"{0}\">{1}</a></span></div>", webConfig.SiteUrl, webConfig.SiteName);
  141. str.Append("</div>");
  142. MailService service = new MailService();
  143. try
  144. {
  145. service.enableSsl(false);
  146. return service.send(to, webConfig.SiteName + "重置密码邮件", str.ToString());
  147. }
  148. catch (Exception ex)
  149. {
  150. errMsg = ex.Message;
  151. return false;
  152. }
  153. }
  154. //public static string GetUserPic(string path,object pic)
  155. //{
  156. // GetUserPic()
  157. // if (pic.ToString() == "")
  158. // {
  159. // return "../img/dp3.png";
  160. // }
  161. // else
  162. // {
  163. // return path + pic;
  164. // }
  165. //}
  166. /// <summary>
  167. /// 将c# DateTime时间格式转换为Unix时间戳格式
  168. /// </summary>
  169. /// <param name="time">时间</param>
  170. /// <returns>long</returns>
  171. public static long ConvertDateTimeToInt(System.DateTime time)
  172. {
  173. System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
  174. long t = (time.Ticks - startTime.Ticks) / 10000000; //除10000调整为13位
  175. return t;
  176. }
  177. public static string GetUserPic(string path, object pic, string def)
  178. {
  179. if (pic.ToString() == "")
  180. {
  181. return def;// "../img/dp3.png";
  182. }
  183. else
  184. {
  185. return path + pic;
  186. }
  187. }
  188. public static string DateStringFromNow(object dt)
  189. {
  190. DateTime nDt = Convert.ToDateTime(dt);
  191. TimeSpan span = DateTime.Now - nDt;
  192. if (span.TotalDays > 30)
  193. {
  194. return nDt.ToString("yyyy.MM.dd");
  195. }
  196. else if (span.TotalDays > 14)
  197. {
  198. return "2周前";
  199. }
  200. else if (span.TotalDays > 7)
  201. {
  202. return "1周前";
  203. }
  204. else if (span.TotalDays > 1)
  205. {
  206. return string.Format("{0}天前", (int)Math.Floor(span.TotalDays));
  207. }
  208. else if (span.TotalHours > 1)
  209. {
  210. return string.Format("{0}小时前", (int)Math.Floor(span.TotalHours));
  211. }
  212. else if (span.TotalMinutes > 1)
  213. {
  214. return string.Format("{0}分钟前", (int)Math.Floor(span.TotalMinutes));
  215. }
  216. else if (span.TotalSeconds >= 1)
  217. {
  218. return string.Format("{0}秒前", (int)Math.Floor(span.TotalSeconds));
  219. }
  220. else
  221. {
  222. return "1秒前";
  223. }
  224. }
  225. public static string getLoginTicket(string acc, string ip)
  226. {
  227. return SecurityHelper.EncryptMD5(acc + "-" + DateTime.Now.ToString("yyMMdd") + "|" + ip);
  228. }
  229. public static string getLoginTicket(string acc)
  230. {
  231. //FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, acc, DateTime.Now, DateTime.Now.AddDays(2), false, Environment.MachineName);
  232. //FormsAuthentication.Encrypt
  233. return SecurityHelper.EncryptMD5(acc + "-" + getLoginMac());
  234. }
  235. [DllImport("Iphlpapi.dll")]
  236. private static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length);
  237. [DllImport("Ws2_32.dll")]
  238. private static extern Int32 inet_addr(string ip);
  239. /// <summary>
  240. /// 获取客户端IP地址
  241. /// </summary>
  242. /// <returns>若失败则返回回送地址</returns>
  243. public static string GetIP()
  244. {
  245. string userHostAddress = "";
  246. //如果客户端使用了代理服务器,则利用HTTP_X_FORWARDED_FOR找到客户端IP地址
  247. if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
  248. {
  249. userHostAddress = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString().Split(',')[0].Trim();
  250. }
  251. //否则直接读取REMOTE_ADDR获取客户端IP地址
  252. if (string.IsNullOrEmpty(userHostAddress))
  253. {
  254. userHostAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
  255. }
  256. //前两者均失败,则利用Request.UserHostAddress属性获取IP地址,但此时无法确定该IP是客户端IP还是代理IP
  257. if (string.IsNullOrEmpty(userHostAddress))
  258. {
  259. userHostAddress = HttpContext.Current.Request.UserHostAddress;
  260. }
  261. //最后判断获取是否成功,并检查IP地址的格式(检查其格式非常重要)
  262. if (!string.IsNullOrEmpty(userHostAddress) && IsIP(userHostAddress))
  263. {
  264. return userHostAddress;
  265. }
  266. string hostName = Dns.GetHostName();
  267. IPHostEntry ipEntry = Dns.GetHostEntry(hostName);
  268. for (int i = 0; i < ipEntry.AddressList.Length; i++)
  269. {
  270. if (ipEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork)
  271. {
  272. userHostAddress = ipEntry.AddressList[i].ToString();
  273. }
  274. }
  275. return userHostAddress;// "127.0.0.1";
  276. }
  277. /// <summary>
  278. /// 检查IP地址格式
  279. /// </summary>
  280. /// <param name="ip"></param>
  281. /// <returns></returns>
  282. public static bool IsIP(string ip)
  283. {
  284. return System.Text.RegularExpressions.Regex.IsMatch(ip, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
  285. }
  286. public static string getLoginMac()
  287. {
  288. // 在此处放置用户代码以初始化页面
  289. try
  290. {
  291. string userip = GetIP();
  292. string strClientIP = HttpContext.Current.Request.UserHostAddress.ToString().Trim();
  293. Int32 ldest = inet_addr(strClientIP); //目的地的ip
  294. Int32 lhost = inet_addr(""); //本地服务器的ip
  295. Int64 macinfo = new Int64();
  296. Int32 len = 6;
  297. int res = SendARP(ldest, 0, ref macinfo, ref len);
  298. string mac_src = macinfo.ToString("X");
  299. if (mac_src == "0")
  300. {
  301. //if (userip == "127.0.0.1")
  302. // Response.Write("正在访问Localhost!");
  303. //else
  304. // Response.Write("欢迎来自IP为" + userip + "的朋友!" + "<br>");
  305. return "";
  306. }
  307. while (mac_src.Length < 12)
  308. {
  309. mac_src = mac_src.Insert(0, "0");
  310. }
  311. string mac_dest = "";
  312. for (int i = 0; i < 11; i++)
  313. {
  314. if (0 == (i % 2))
  315. {
  316. if (i == 10)
  317. {
  318. mac_dest = mac_dest.Insert(0, mac_src.Substring(i, 2));
  319. }
  320. else
  321. {
  322. mac_dest = "-" + mac_dest.Insert(0, mac_src.Substring(i, 2));
  323. }
  324. }
  325. }
  326. return userip + mac_dest;
  327. }
  328. catch (Exception err)
  329. {
  330. XLog.SaveLog(0, err.Message);
  331. return "";
  332. }
  333. }
  334. //public static int ConvertDateTimeToInt(System.DateTime time)
  335. //{
  336. // System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
  337. // return (int)(time - startTime).TotalSeconds;
  338. //}
  339. public static DateTime ConvertStringToDateTime(string timeStamp)
  340. {
  341. DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
  342. long lTime = long.Parse(timeStamp + "0000000");
  343. TimeSpan toNow = new TimeSpan(lTime);
  344. return dtStart.Add(toNow);
  345. }
  346. private static string getRandNum(int s, int e)
  347. {
  348. Random rd = new Random((int)DateTime.Now.Ticks);
  349. return rd.Next(s, e).ToString();
  350. }
  351. public static string EnscryptNumber(string code)
  352. {
  353. if (code == "") return "";
  354. if (code.Length > 6) code = code.Substring(4);
  355. string ct = ConvertDateTimeToInt(DateTime.Now).ToString();
  356. code = ct.Substring(5) + getRandNum(1, 9) + code + ct.Substring(0, 5);
  357. int r = getSeed();
  358. return EnscryptNumber(r, code);
  359. }
  360. public static int getSeed()
  361. {
  362. return Convert.ToInt32(getRandNum(2, 9));
  363. }
  364. public static string EnscryptNumber(int r, string code)
  365. {
  366. List<string> lst = new List<string>();
  367. for (int i = 0; i < code.Length; i++)
  368. {
  369. int c = Convert.ToInt32(code[i].ToString()) + r;
  370. if (c >= 10) c = c - 10;
  371. lst.Add(c.ToString());
  372. }
  373. string v = string.Join("", lst.ToArray());
  374. v = v.Insert(0, r.ToString());
  375. return v;
  376. }
  377. public static string DescryptNumber(string code)
  378. {
  379. int len = code.Length;
  380. int r = Convert.ToInt32(code.Substring(0, 1));
  381. code = code.Remove(0, 1);
  382. List<string> lst = new List<string>();
  383. for (int i = 0; i < code.Length; i++)
  384. {
  385. int c = Convert.ToInt32(code[i].ToString()) - r;
  386. if (c < 0) c = c + 10;
  387. lst.Add(c.ToString());
  388. }
  389. return string.Join("", lst.ToArray());
  390. }
  391. public static string getUserCode(string code)
  392. {
  393. if (code.Length < 8) return "";
  394. return code.Substring(6, 6);
  395. }
  396. //判断时间
  397. public static bool isLegalTime(string code)
  398. {
  399. if (code.Length < 8) return false;
  400. string timeStamp = code.Substring(code.Length - 5) + code.Substring(0, 5);
  401. DateTime dTime = ConvertStringToDateTime(timeStamp);
  402. if (DateTime.Now.Subtract(dTime).TotalMinutes <= 5)
  403. {
  404. return true;
  405. }
  406. return false;
  407. }
  408. public static bool isWeiXinAgent(string userAgent)
  409. {
  410. if (userAgent.ToLower().Contains("micromessenger"))
  411. {
  412. return true;
  413. }
  414. return false;
  415. }
  416. public static string getEncodeCode(int id, int state)
  417. {
  418. string uid = SecurityHelper.EncryptSymmetric(id.ToString());
  419. string con = DecryptHelper.Encrypt(getRandNum(1, 5000) + "|" + uid + "|" + state + "|" + ConvertDateTimeToInt(DateTime.Now) + "|" + getRandNum(1000, 3000));
  420. return con;
  421. }
  422. public static string getEncodeCodeByEUser(object uid, object state)
  423. {
  424. string con = DecryptHelper.Encrypt(getRandNum(1, 5000) + "|" + uid + "|" + state + "|" + ConvertDateTimeToInt(DateTime.Now) + "|" + getRandNum(1000, 3000));
  425. return HttpUtility.UrlEncode(con);
  426. }
  427. public static string getCodeByEUser(object uid, object state)
  428. {
  429. string con = DecryptHelper.Encrypt(getRandNum(1, 5000) + "|" + uid + "|" + state + "|" + ConvertDateTimeToInt(DateTime.Now) + "|" + getRandNum(1000, 3000));
  430. return con;
  431. }
  432. public static string getEncodeCodeByNormal(string code)
  433. {
  434. string[] sArr = code.ToString().Split('|');
  435. return getEncodeCode(Convert.ToInt32(sArr[0]), Convert.ToInt32(sArr[1]));
  436. }
  437. public static int getUid(string tmp)
  438. {
  439. string uid = SecurityHelper.DecryptSymmetric(tmp);
  440. return Convert.ToInt32(uid);
  441. }
  442. //public static string getEncodeCodeUnUser(string code)
  443. //{
  444. // string[] sArr = code.ToString().Split('|');
  445. // return getEncodeCodeUnUser(sArr[0], sArr[1]);
  446. //}
  447. public static int getDecodeUid(string tmp)
  448. {
  449. try
  450. {
  451. string t = HttpUtility.UrlDecode(tmp);
  452. t = DecryptHelper.Decrypt(t);
  453. string[] tArr = t.Split('|');
  454. tArr[0] = SecurityHelper.DecryptSymmetric(tArr[0]);
  455. return Convert.ToInt32(tArr[0]);
  456. }
  457. catch
  458. {
  459. }
  460. return 0;
  461. }
  462. public static string[] getDecodeArr(string tmp)
  463. {
  464. try
  465. {
  466. string t = DecryptHelper.Decrypt(tmp);
  467. string[] tArr = t.Split('|');
  468. return tArr;
  469. }
  470. catch
  471. {
  472. }
  473. return null;
  474. }
  475. static string cname = "wx_quduba";
  476. public static void addCookie(string key, string value)
  477. {
  478. HttpCookie cookie = new HttpCookie(cname);
  479. cookie.Values.Clear();
  480. cookie.Values.Add(key, value);
  481. cookie.Path = "/";
  482. cookie.Domain = webConfig.SiteDomain;
  483. cookie.Expires = DateTime.Now.AddDays(2);
  484. HttpContext.Current.Response.Cookies.Add(cookie);
  485. }
  486. public static string getCookie(string key)
  487. {
  488. HttpCookie cookie = HttpContext.Current.Request.Cookies[cname];
  489. if (cookie != null)
  490. return cookie.Values[key];
  491. return "";
  492. }
  493. public static void delCookie(string key)
  494. {
  495. if (key == "") return;
  496. HttpCookie cookie = new HttpCookie(key);
  497. cookie.Expires = DateTime.Now.AddDays(-1d);
  498. HttpContext.Current.Response.Cookies.Add(cookie);
  499. }
  500. public static List<DateTime> GetStartEndDateTime(string dateType = "")
  501. {
  502. List<DateTime> RetDT = new List<DateTime>();
  503. switch (dateType)
  504. {
  505. case "Today":
  506. case "0":
  507. RetDT = GetTodayStartEndTime();
  508. break;
  509. case "1":
  510. case "Week":
  511. RetDT = GetWeekStartEndTime();
  512. break;
  513. case "2":
  514. case "Month":
  515. RetDT = GetMonthStartEndTime();
  516. break;
  517. default:
  518. RetDT = GetTodayStartEndTime();
  519. break;
  520. }
  521. return RetDT;
  522. }
  523. public static List<DateTime> GetTodayStartEndTime()
  524. {
  525. List<DateTime> RetDT = new List<DateTime>();
  526. RetDT.Add(DateTime.Now.Date);
  527. RetDT.Add(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59"));
  528. return RetDT;
  529. }
  530. public static List<DateTime> GetWeekStartEndTime()
  531. {
  532. DateTime dt = DateTime.Now;
  533. int dayOfWeek = (int)dt.Date.DayOfWeek;
  534. //Sunday = 0,Monday = 1,Tuesday = 2,Wednesday = 3,Thursday = 4,Friday = 5,Saturday = 6,
  535. DateTime weekStartTime = dt.AddDays(-1 * dayOfWeek + 1);//取本周一
  536. if (dayOfWeek == 0) //如果今天是周日,则开始时间是上周一
  537. {
  538. weekStartTime = weekStartTime.AddDays(-7);
  539. }
  540. DateTime weekEndTime = dt.AddDays(7 - dayOfWeek);//取本周日
  541. if (dayOfWeek == 0) //如果今天是周日,则开始时间是上周一
  542. {
  543. weekEndTime = weekEndTime.AddDays(-7);
  544. }
  545. List<DateTime> RetDT = new List<DateTime>();
  546. RetDT.Add(weekStartTime.Date);
  547. RetDT.Add(DateTime.Parse(weekEndTime.ToString("yyyy-MM-dd") + " 23:59:59"));
  548. return RetDT;
  549. }
  550. public static List<DateTime> GetMonthStartEndTime()
  551. {
  552. DateTime dt = DateTime.Now;
  553. //本月第一天时间
  554. DateTime dt_First = dt.AddDays(1 - (dt.Day));
  555. //获得某年某月的天数
  556. int year = dt.Date.Year;
  557. int month = dt.Date.Month;
  558. int dayCount = DateTime.DaysInMonth(year, month);
  559. //本月最后一天时间
  560. DateTime dt_Last = dt_First.AddDays(dayCount - 1);
  561. List<DateTime> RetDT = new List<DateTime>();
  562. RetDT.Add(dt_First.Date);
  563. RetDT.Add(DateTime.Parse(dt_Last.ToString("yyyy-MM-dd") + " 23:59:59"));
  564. return RetDT;
  565. }
  566. }
  567. }