随笔分类 -  C#

摘要:本文讲述c#中如何转义双引号。 c#中转义双引号",使用的转义字符仍然是\。 string str = "\"www.itjsxx.com\""; 但是,在c#的逐字字符中,双引号的转义字符不能用\了,会报错,而是用两个双引号""来表示"。 string str1 = @"""www.itjsxx. 阅读全文
posted @ 2017-02-22 20:06 小小高 阅读(4290) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Web.Http.Filters; public class AllowCrossSiteJsonAttribute : ActionFilterAttribute { public override void OnActionExecuted(HttpActionExecutedContext actionExecutedCont... 阅读全文
posted @ 2016-12-27 00:27 小小高 阅读(244) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Taoke.filter { public class corsAttribute : ActionFilterAttribute { ... 阅读全文
posted @ 2016-12-24 19:20 小小高 阅读(240) 评论(0) 推荐(0) 编辑
摘要:public static string EncryptWithMD5(string source) { byte[] sor = Encoding.UTF8.GetBytes(source); MD5 md5 = MD5.Create(); byte[] result = md5.ComputeHash... 阅读全文
posted @ 2016-12-24 19:18 小小高 阅读(14257) 评论(0) 推荐(0) 编辑
摘要:记一次访问http数据接口的爬坑经历,一般访问一个http接口。 无非就是这么几行代码: 可是这次,死话乱码。PostMan下正常的。。在浏览器中直接访问,设置编码为utf-8b也是可以正常显示的。。用c#后台代码测试了各种编码都以无效,告终。。 查看响应头: Content-Encoding gz 阅读全文
posted @ 2016-11-24 17:00 小小高 阅读(3341) 评论(0) 推荐(0) 编辑
摘要://中国天气网的实时天气接口,经测试,实时温度不是室外温度,湿度貌似可以用。 //101200901.html :101200901为地区天气区码(自行baidu) http://www.weather.com.cn/data/sk/101200901.html //一个可用的天气预报接口 http 阅读全文
posted @ 2016-11-24 16:43 小小高 阅读(806) 评论(0) 推荐(0) 编辑
摘要:string fullPath = @"\WebSite1\Default.aspx"; string filename = System.IO.Path.GetFileName(fullPath);//文件名 “Default.aspx” string extension = System.IO.Path.GetExtension(fullPath);//扩展名 “.aspx” strin... 阅读全文
posted @ 2016-11-07 09:56 小小高 阅读(239) 评论(0) 推荐(0) 编辑
摘要:http://bbs.csdn.net/topics/390677299 阅读全文
posted @ 2016-10-25 10:34 小小高 阅读(251) 评论(0) 推荐(0) 编辑
摘要:二、dfdsdfdsf: 11111三、dfsdfsdfds:Regex reg = new Regex(@"\n.*、.{1,}:\s{1,}");匹配 二、xxxxxxx:X、xxxxxxx: 正则验证是字母还是汉字 字母 /^[a-zA-Z]*$/ 汉字 /^[\u4e00-\u9fa5]*$ 阅读全文
posted @ 2016-06-12 15:24 小小高 阅读(128) 评论(0) 推荐(0) 编辑
摘要:public class GC_ModelBindcs : IModelBinder { public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { List model = (List)bin... 阅读全文
posted @ 2016-06-01 16:28 小小高 阅读(265) 评论(0) 推荐(0) 编辑
摘要:全局过滤器: NO全局过滤器: FilterConfig.cs Jquery: 阅读全文
posted @ 2016-05-30 16:20 小小高 阅读(569) 评论(0) 推荐(0) 编辑
摘要:客户端代码: 服务端: 客户端调用: Upload_Request("http://localhost:7115/test/index", "d:\\t.rar", "kk"); 阅读全文
posted @ 2016-05-20 15:52 小小高 阅读(9622) 评论(0) 推荐(0) 编辑
摘要:不保留 不删注释: 阅读全文
posted @ 2016-05-18 14:38 小小高 阅读(2881) 评论(0) 推荐(0) 编辑
摘要://System.Management;//需要添加引用(系统自带) /// /// 获取cpu编号 /// /// public String GetCpuID() { try { ManagementClass ... 阅读全文
posted @ 2016-05-12 16:24 小小高 阅读(1800) 评论(0) 推荐(0) 编辑
摘要:[DllImport("user32.dll", EntryPoint = "SetWindowPos",CharSet = CharSet.Auto)] static extern bool SetWindowPos( IntPtr hWnd, IntPtr hWndInsertAfter, int X, in... 阅读全文
posted @ 2016-05-09 21:38 小小高 阅读(751) 评论(0) 推荐(0) 编辑
摘要:发请求 处理请求: 阅读全文
posted @ 2016-05-06 13:44 小小高 阅读(686) 评论(0) 推荐(0) 编辑
摘要:static void Main(string[] args) { Console.WriteLine("请输入ip"); string ip = Console.ReadLine(); Parallel.For(1, 65535, i => scan(ip, i, 200)); ... 阅读全文
posted @ 2016-05-06 09:04 小小高 阅读(543) 评论(0) 推荐(0) 编辑
摘要:调c++写的dll时报这个错,解决方案如下: 项目右键属性->项目设计器->生成->平台->把'默认设置(任何 CPU)'改为x86。 因为'任何 CPU'的程序在64位的机器上就会用运行为64位,而64程序是不能加载32位dll的 阅读全文
posted @ 2016-04-26 13:58 小小高 阅读(1045) 评论(0) 推荐(0) 编辑
摘要:使用如下: List<YEWULIANG> list=new List<YEWULIANG> (){ new YEWULIANG {name="1",age=12} , new YEWULIANG {name="1",age=13} , new YEWULIANG {name="2",age=14} 阅读全文
posted @ 2016-04-12 13:55 小小高 阅读(2728) 评论(0) 推荐(0) 编辑
摘要:html代码如: 服务器端读取的常规做法是: string name = Request.Params["txtName"]; asp.net后台代码如: 参考 晓风残月的随笔 http://www.cnblogs.com/Jinglecat/archive/2008/06/01/1211753.h 阅读全文
posted @ 2016-04-06 09:20 小小高 阅读(728) 评论(1) 推荐(0) 编辑

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