摘要: 以前在做网站的时候,经常会遇到当前页的分类高亮显示,以便让用户了解当前处于哪个页面。之前一直是在每个不同页面写方法。工程量大,也不便于修 改。一直在想有什么简便的方法实现。后来在网上查到可以用获取当前URL的详细信息来判断。所以收集了JQUERY获取URL的函数的资料。设置或获取对象指定的文件名或路径。 window.location.pathname 例:http://localhost:8086/topic/index?topicId=361 alert(window.location.pathname); 则输出:/topic/index 设置或获取整个 URL 为字符串。 window 阅读全文
posted @ 2013-02-28 17:48 chasecnblogs 阅读(195) 评论(0) 推荐(0) 编辑
摘要: public static void SetDataGridCellIsEnabled(DataGrid datagrid, int rowIndex, int[] cellIndexArray, bool IsEnabled) { for (int index = 0; index < cellIndexArray.Length; index++) { DataGridCell currentCell = GetDataGridCell(datagrid, rowIndex, cellIndexArray[index]); if (currentCell != null) { ... 阅读全文
posted @ 2013-01-17 18:31 chasecnblogs 阅读(2309) 评论(0) 推荐(0) 编辑
摘要: 1.选择排序 选择排序基本原理: int[] SeqList={3,9,1,4,2,8,6,5,7}; 步骤1:将数字“3”逐一与其他数字比较,发现比3小的数则记录此数(如:1<3)。然后用“1”再与后面的数进行比较,依此类推。 步骤2:将数字 “1”与“3”调换。 private static void SelectSort() { int[] SeqList = { 3, 9, 1, 4, 2, 8, 6, 5, 7 }; for (int i = 0; i < SeqList.Length; i++) { int k = i;//k是为了记录最小值的下标 for (int j 阅读全文
posted @ 2013-01-08 16:55 chasecnblogs 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 经常我们会碰到如果某个文件被更改,能够做出对应的操作。public class FileWatch{ public static FileSystemWatcher _fileWatcher; private static readonly object _lockObj = new object(); private static void SetWatch(string path) { if(_fileWatcher==null) { lock(_lockObj) { if(_fileWatcher==null) { ... 阅读全文
posted @ 2013-01-04 12:04 chasecnblogs 阅读(439) 评论(1) 推荐(1) 编辑
摘要: 1.引用命名空间 using System.ServiceModel;2.方法 public static void SetWcfHeader() { //如果需要传递多个值,因泛型,可考虑用类。 MessageHeader<string> ip = new MessageHeader<string>("192.168.1.1"); //ipName可随意命名,它在读取的时候传递这个名称就能读取到它的值,"http://wcf/"可随意命名,在读取的时候也需要传递与之相同 System.ServiceModel.Channels. 阅读全文
posted @ 2012-12-31 14:49 chasecnblogs 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 得到今天的周月开始与结束 阅读全文
posted @ 2012-12-28 14:27 chasecnblogs 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 实现简单的WPF 倒计时.. 阅读全文
posted @ 2012-12-27 11:02 chasecnblogs 阅读(7070) 评论(2) 推荐(2) 编辑
摘要: 命名空间: using System.Runtime.Serialization; using System.Reflection;1.定义枚举 View Code /// <summary> /// 银行简码 /// </summary> [DataContract] public enum BankCode { [EnumMember] [Description("中行")] boc = 95559, [EnumMember] [Description("工行")] ... 阅读全文
posted @ 2012-12-26 14:37 chasecnblogs 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 引用msdn的语法1.创建链接服务器语法:EXECsp_addlinkedserver [ @server= ] 'server' [ , [ @srvproduct= ] 'product_name' ] [ , [ @provider= ] 'provider_name' ] [ , [ @datasrc= ] 'data_source' ] [ , [ @location= ] 'location' ] [ , [ @provstr= ] 'provider_string' ] [ , [ @ 阅读全文
posted @ 2012-12-25 18:30 chasecnblogs 阅读(734) 评论(0) 推荐(0) 编辑