随笔分类 -  ASP.NET

摘要://匹配字符串中的连续数字 string txt = "AAA12345678AAAA"; string m = Regex.Match(txt, @"\d+").Value; Console.WriteLine(m); 正则表达式中()是代表分组 例如:(\d{1})(\d{1}) 整个表达式是第 阅读全文
posted @ 2016-04-01 10:06 苦逼的猿人 阅读(6739) 评论(0) 推荐(0)
摘要://提取字符串中至少连续7位的数字 string txt = "www17736123780eeeee 7377091 ddddsssss7777777"; //找到的成功匹配的集合 MatchCollection mc = Regex.Matches(txt, @"\d{7,}"); foreac 阅读全文
posted @ 2016-04-01 09:38 苦逼的猿人 阅读(10143) 评论(0) 推荐(0)
摘要:下面这个是一段JSON字符串宏观图 下面我们通过C#读取JSON字符串里的任何一个数值 string jsonString="上面JSON字符串"; //需要引用Newtonsoft.Json.dll JObject json = JObject.Parse(jsonString); //下面我们读 阅读全文
posted @ 2016-03-28 16:49 苦逼的猿人 阅读(6237) 评论(0) 推荐(0)
摘要:发送POST请求 /// <summary> /// API发送POST请求 /// </summary> /// <param name="url">请求的API地址</param> /// <param name="parametersJson">POST过去的参数(JSON格式)字符串</pa 阅读全文
posted @ 2016-03-01 16:01 苦逼的猿人 阅读(3228) 评论(0) 推荐(0)
摘要:System.Web.HttpContext.Current.Request.ContentEncoding = Encoding.GetEncoding("UTF-8"); System.Web.HttpContext.Current.Response.ContentEncoding = Enco 阅读全文
posted @ 2016-02-19 11:13 苦逼的猿人 阅读(303) 评论(0) 推荐(0)
摘要://有的时候剪切图片时,出现图片失真的问题,是因为图片质量下降造成的//按照指定的数据画出画板(位图)System.Drawing.Image imgPhoto = System.Drawing.Image.FromFile(imgPath);Bitmap bmPhoto=new Bitmap(Cu... 阅读全文
posted @ 2015-04-21 15:12 苦逼的猿人 阅读(363) 评论(0) 推荐(0)
摘要:#region 缩略名 public staticstring GetSpellCode(stringCnStr) { string strTemp = ""; int iLen = CnStr.Length; ... 阅读全文
posted @ 2015-04-20 14:38 苦逼的猿人 阅读(264) 评论(0) 推荐(0)
摘要:前段代码如下$("#file_upload").uploadify({ 'auto': true, 'swf': '/template/js/cutImg/uploadify/uploadify.swf', 'uploader': '/template/js... 阅读全文
posted @ 2015-04-20 13:54 苦逼的猿人 阅读(232) 评论(0) 推荐(0)