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

浙公网安备 33010602011771号