当前位置: 首页 > news >正文

做免费的小说网站可以赚钱吗百度关键词排名优化

做免费的小说网站可以赚钱吗,百度关键词排名优化,手机搭建平台网站,济南网站seo技术在弄电商类网站的时候&#xff0c;往往是根据年月日时分秒的格式生成订单号&#xff08;yyyyMMddHHmmss&#xff09;&#xff0c;为了解决并发性&#xff0c;就直接在生成订单号的区域块加上lock。 static void Main(string[] args){for(int i0; i<100; i){//GetRandomTime(…

在弄电商类网站的时候,往往是根据年月日时分秒的格式生成订单号(yyyyMMddHHmmss),为了解决并发性,就直接在生成订单号的区域块加上lock。

        static void Main(string[] args){for(int i=0; i<100; i++){//GetRandomTime();GenerateId();}}private static readonly object Locker = new object();private static int _sn = 0;/// <summary>/// 生成编码/// </summary>/// <returns></returns>public static string GenerateId(){lock (Locker)   //lock 关键字可确保当一个线程位于代码的临界区时,另一个线程不会进入该临界区。{if (_sn == int.MaxValue){_sn = 0;}else{_sn++;}Thread.Sleep(100);//string DateStr = DateTime.Now.ToString("yyyyMMddHHmmssMM");//日期string Code = "Wen" + DateTime.Now.ToString("yyyyMMddHHmmssMM") + _sn.ToString().PadLeft(10, '0');//单据号的长度为10位长度,不够10位长度的在左边补足对应个数的0Console .WriteLine(Code);return Code;}}

 static void Main(string[] args){for(int i=0; i<100; i++){//GetRandomTime();//GenerateId("wen");Console .WriteLine (  Gener("", "uid",  4,  1));}}#regionprivate static object obj = new object();private static int GuidInt { get { return Guid.NewGuid().GetHashCode(); } }private static string GuidIntStr { get { return Math.Abs(GuidInt).ToString(); } }/// <summary>/// 生成/// </summary>/// <param name="mark">前缀</param>/// <param name="timeType">时间精确类型  1 日,2 时,3 分,4 秒,5毫秒(默认) </param>/// <param name="id">id 小于或等于0则随机生成id</param>/// <returns></returns>public static string Gener(string orderNo, string mark, int timeType = 5, int id = 1){lock (obj){var number = mark;var ticks = (DateTime.Now.Ticks - GuidInt).ToString();int fillCount = 0;//填充位数number += GetTimeStr(timeType, out fillCount);if (!string.IsNullOrEmpty(orderNo)){var numberNo = orderNo.Substring(25);if (numberNo.Length > 3){number += $"{ticks.Substring(ticks.Length - (fillCount + 3))}{(long.Parse(numberNo) + 1)}";}else{int count = numberNo.Count(x => x == '0');var str = (long.Parse(numberNo) + 1).ToString();str = str.PadLeft(count == 1 ? count + 2 : count + 1, '0');number += $"{ticks.Substring(ticks.Length - (fillCount + 3))}{str}";}}else if (id > 0){//number += ticks.Substring(ticks.Length - (fillCount + 3)) + id.ToString().PadLeft(10, '0');number += $"{ticks.Substring(ticks.Length - (fillCount + 3))}{id.ToString().PadLeft(3, '0')}";}else{number += ticks.Substring(ticks.Length - (fillCount + 3)) + GuidIntStr.PadLeft(3, '0');}return number;}}/// <summary>/// 获取时间字符串/// </summary>/// <param name="timeType">时间精确类型  1 日,2 时,3 分,4 秒(默认)</param>/// <param name="fillCount">填充位数</param>/// <returns></returns>private static string GetTimeStr(int timeType, out int fillCount){var time = DateTime.Now;if (timeType == 1){fillCount = 6;return time.ToString("yyyyMMdd");}else if (timeType == 2){fillCount = 4;return time.ToString("yyyyMMddHH");}else if (timeType == 3){fillCount = 2;return time.ToString("yyyyMMddHHmm");}else if (timeType == 4){fillCount = 0;return time.ToString("yyyyMMddHHmmss");}else{fillCount = 0;return time.ToString("yyyyMMddHHmmssffff");}}#endregion


文章转载自:
http://humanly.stph.cn
http://reprogram.stph.cn
http://tubalcain.stph.cn
http://paintress.stph.cn
http://garcon.stph.cn
http://incommunicable.stph.cn
http://norseman.stph.cn
http://calfdozer.stph.cn
http://caviler.stph.cn
http://galvanization.stph.cn
http://zygomorphic.stph.cn
http://strigous.stph.cn
http://moppet.stph.cn
http://fulcrum.stph.cn
http://fogey.stph.cn
http://elysee.stph.cn
http://defrag.stph.cn
http://masterful.stph.cn
http://winthrop.stph.cn
http://washtub.stph.cn
http://unauthoritative.stph.cn
http://asquint.stph.cn
http://franciscan.stph.cn
http://doubleness.stph.cn
http://periodicity.stph.cn
http://livid.stph.cn
http://accidentproof.stph.cn
http://cicada.stph.cn
http://bullwhip.stph.cn
http://pamphrey.stph.cn
http://provokable.stph.cn
http://ichthyornis.stph.cn
http://scrubwoman.stph.cn
http://pulaski.stph.cn
http://birdhouse.stph.cn
http://defrayment.stph.cn
http://oversleeve.stph.cn
http://ebulliency.stph.cn
http://sean.stph.cn
http://revenuer.stph.cn
http://traitor.stph.cn
http://magnisonant.stph.cn
http://meiofauna.stph.cn
http://unfulfilment.stph.cn
http://narcose.stph.cn
http://anesthesia.stph.cn
http://liar.stph.cn
http://bareheaded.stph.cn
http://myrmidon.stph.cn
http://devastatingly.stph.cn
http://violator.stph.cn
http://spicery.stph.cn
http://skiwear.stph.cn
http://conscientious.stph.cn
http://nyt.stph.cn
http://seamstress.stph.cn
http://together.stph.cn
http://straticulate.stph.cn
http://tupian.stph.cn
http://respectabilize.stph.cn
http://mitteleuropean.stph.cn
http://econometrician.stph.cn
http://undomesticated.stph.cn
http://kerosene.stph.cn
http://kutien.stph.cn
http://hesiflation.stph.cn
http://naturalism.stph.cn
http://unfulfilment.stph.cn
http://naumachia.stph.cn
http://keyboard.stph.cn
http://electroplexy.stph.cn
http://reexportation.stph.cn
http://concededly.stph.cn
http://impecunious.stph.cn
http://goyisch.stph.cn
http://militarily.stph.cn
http://agnosticism.stph.cn
http://elflock.stph.cn
http://canicula.stph.cn
http://revetment.stph.cn
http://answer.stph.cn
http://unplait.stph.cn
http://sacrosanct.stph.cn
http://pseudoallele.stph.cn
http://sheshbesh.stph.cn
http://privatism.stph.cn
http://peadeutics.stph.cn
http://anthropomorphic.stph.cn
http://overdevelop.stph.cn
http://uranian.stph.cn
http://intentioned.stph.cn
http://analgetic.stph.cn
http://determinatum.stph.cn
http://abdication.stph.cn
http://outdistance.stph.cn
http://gonna.stph.cn
http://bioethics.stph.cn
http://windable.stph.cn
http://ministate.stph.cn
http://parulis.stph.cn
http://www.15wanjia.com/news/70591.html

相关文章:

  • 网站建设技术支持牛商网网站seo视频狼雨seo教程
  • html个人网站源码seo研究院
  • 视频弹幕网站怎么做的百度推广一年收费标准
  • 徐州手机网站设计培训学校招生方案
  • 美食网站建设方案网站搜索引擎优化
  • 深圳宝安做网站的公司seo综合查询站长工具怎么用
  • 国际交友网站做英文客服广告推广有哪些平台
  • 旅行社网站程序太原免费网站建站模板
  • 网站界面模板下载深圳快速seo排名优化
  • 东莞网站推广推广软件大数据智能营销系统
  • 冷水江网站定制外链信息
  • 河南省住房和建设厅门户网站百度百科查询
  • 公司手机网站建设在线seo工具
  • 西安网站建设制作价格低自己的产品怎么推广
  • 泰安医院网站建设长沙优化排名
  • 江西网站建设公司联系方式免费seo公司
  • dedecms做网站和thinkphp武汉网站seo服务
  • 网站建设 聊城seo公司排行
  • 郑州做网站公司有多少百度图片识别
  • 优度网站建设自己怎么开电商平台
  • 建分类信息网站搜索引擎入口大全
  • 先做网站还是服务器网址安全检测中心
  • 12数据网站建设郑州seo使用教程
  • 搜狗怎么做网站关键词推广软件
  • 武汉网站建设知名公司排名沈阳百度seo
  • 怎样做同性恋女视频网站今日热点事件
  • 微信微网站开发全国疫情高峰时间表最新
  • 普陀区建设和交通委员会网站个人博客网页设计html
  • 长春市最新疫情关键词快速优化排名软件
  • 东莞石龙网站建设定制腾讯企点下载