摘要: 以前做过的异步接收信息,采用socket通信。 首先建立连接,绑定端口、开始监听,然后异步接收数据,最后处理数据。 private static List _listData = new List(); public static string callBack = ""; public static List listData { get { return _listData; } set { _listData = value; } } static object LockClientSocket = new object(); static Socket client 阅读全文
posted @ 2013-07-16 23:37 戒一字 阅读(735) 评论(0) 推荐(0) 编辑
摘要: 以前一直觉得泛型比较好用,一直没使用DataTable,最近发现泛型也不是万能的,比如将行转成列。 虽然这种在前台JS转比较方便,但可能也需要这样的接口,提供别人调用,还是记录一下。/// /// 将行转成列 /// DataTable dtResult = Utility.ConvertDataTableToVertical(dt, "ID", new string[]{"Code","StationName"}, new string[] { "Value", "Name", "I 阅读全文
posted @ 2013-07-16 16:59 戒一字 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 今天用highcharts做饼图和柱状图,显示一些简单信息,发现柱状图做出来有点不尽人意,还是请教同事才将线去掉。 data里面的是后台数据,就不显示出来了,主要就是yAxis中的gridLineWidth赋0,想了半天,看来还是请教比较方便。。。。 var Chart = new Highcharts.Chart({ chart: { type: 'column', ... 阅读全文
posted @ 2013-07-16 16:41 戒一字 阅读(419) 评论(0) 推荐(0) 编辑
摘要: jQuery 是一个 JavaScript 函数库。jquery选择器1.元素选择器 $("p")选取 元素,$(".") 选取所有 class,$("#")选取所有 id。2.属性选择器$("[]") []里面填写属性,如$("[href='#']") 选取所有带有 href 值等于 "#" 的元素。3.css选择器,如$("p").css("background-color","red")。--选 阅读全文
posted @ 2013-07-15 15:13 戒一字 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 经常使用放大缩小功能,各种宽度和高度就常被用到。1 显示器分辨率宽度 window.screen.width2 显示器分辨率高度 window.screen.height3 显示器可用工作区宽度=显示器分辨率宽度-左边任务栏宽度 window.screen.availWidth4 显示器可用工作区高度=显示器分辨率高度-下边任务栏高度 window.screen.availHeight5 获得用于该元素具体的定位信息 /// /// 1: jQueryExtension.Window.Document.Element.Position(Properties) - 获得用于该元素具体的定位信.. 阅读全文
posted @ 2013-07-15 13:07 戒一字 阅读(207) 评论(0) 推荐(0) 编辑
摘要: //js、C#、sql三种的Trim竟然都不一样,才发现//js//TrimString.prototype.Trim = function () {return this.replace(/^s*|\s$/g, '');};//C# value.Trim()//sql //ltrim(rtrim(value))//ToJsonStringString.prototype.ToJsonString = function () {return this.replace(/'/g, "\\'");};//ToListString.prototyp 阅读全文
posted @ 2013-07-15 11:19 戒一字 阅读(259) 评论(0) 推荐(0) 编辑