随笔分类 -  C# .Net

摘要:string notifyUrl = data["notifyurl"].ToString(); CancellationTokenSource tokenSource = new CancellationTokenSource(); //启用线程,得到回应"SUCCESS",中断线程,没有回应,连续发送5次信息 var t = System.Threading.Tasks.Task.Run(... 阅读全文
posted @ 2019-11-28 15:55 AlexLeeLi 阅读(102) 评论(0) 推荐(0) 编辑
摘要:void CreateUrlQRCodeIMG() { Response.Cache.SetCacheability(HttpCacheability.Public); Response.Cache.SetMaxAge(TimeSpan.FromSeconds(600000)); Response.ContentType = "i... 阅读全文
posted @ 2019-03-11 14:41 AlexLeeLi 阅读(433) 评论(0) 推荐(0) 编辑
摘要:void GetCheckCode() { string code = Encrypt.CreateRandomCode(4); //验证码的字符为4个 Response.ContentType = "image/jpg";//没有这个会出现乱码 Response.BinaryWrite(Encrypt.CreateValidate... 阅读全文
posted @ 2019-03-11 14:36 AlexLeeLi 阅读(1209) 评论(0) 推荐(0) 编辑
摘要:1.SqlServer 10进制转换成62进制,写成函数方法 2.C# 10进制转换成62进制 阅读全文
posted @ 2019-03-05 15:35 AlexLeeLi 阅读(303) 评论(0) 推荐(0) 编辑
摘要://获取存储的缓存 var cacheObject = HttpContext.Current.Cache.Get(cacheKey); //插入缓存设置过期时间为30分钟 HttpContext.Current.Cache.Insert(cacheKey, result, null, DateTi 阅读全文
posted @ 2018-09-29 17:04 AlexLeeLi 阅读(208) 评论(0) 推荐(0) 编辑
摘要:<!--新浪微博社区登陆接口--> <add key="SinaWeibo.AppKey" value="*******"/> <add key="SinaWeibo.AppSercet" value="*******"/> <add key="SinaWeibo.CallbackUrl" valu 阅读全文
posted @ 2017-05-10 12:03 AlexLeeLi 编辑
摘要:public static string UserMd5(string str) { string cl = str; string pwd = ""; MD5 md5 = MD5.Create();//实例化一个md5对像 // 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等 阅读全文
posted @ 2017-05-10 11:53 AlexLeeLi 阅读(215) 评论(0) 推荐(0) 编辑
摘要:1.引用Newtonsoft.Json.dll 2.用API /// <summary> /// 判断是不是节假日,节假日返回true /// </summary> /// <param name="date">日期格式:yyyyMMdd</param> /// <returns></returns 阅读全文
posted @ 2017-05-10 11:48 AlexLeeLi 阅读(828) 评论(0) 推荐(0) 编辑
摘要:int i=10;方法1:Console.WriteLine(i.ToString("D5"));方法2:Console.WriteLine(i.ToString().PadLeft(5,'0'));//推荐方法3:Console.WriteLine(i.ToString("00000")); 在 阅读全文
posted @ 2016-12-21 11:20 AlexLeeLi 阅读(692) 评论(0) 推荐(0) 编辑
摘要:string[] elements = new string[50]; if (Array.IndexOf<string>(elements, "a" ) != -1 ) { //存在 //返回的值就是 "a" 在数组中的下标 } else { //不存在 } 阅读全文
posted @ 2016-12-09 16:15 AlexLeeLi 阅读(670) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示