阿修--一直在自我修炼,希望能得到百年道行

湖南微软开发者俱乐部

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

随笔分类 -  C# 2.0

摘要:public class Book{ [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Required, MaxLength(50)] public string Title { get; set; } public Double? Price { get; set; }}解决方案一:var bkList = db.Books.Select(allBooks => new { Id ... 阅读全文
posted @ 2013-08-12 10:31 阿修 阅读(1952) 评论(0) 推荐(1)

摘要:今天有朋友问题我如何获取某年中第几个礼拜的时间范围,似乎以前好像记得.NET有,不过今天一查没有翻到,在google搜索到这个,希望以后能自己用上,测试已经通过。 public static void Main() { DateTime date1 = GoToWeek(2012, 2); Console.Write(date1.ToString()); Console.Read(); } private static DateTime GoToWeek(int year,... 阅读全文
posted @ 2012-03-05 15:59 阿修 阅读(588) 评论(0) 推荐(0)

摘要:今天在做ADO.NET中的adapter进行数据自动触发更新数据库功能,发现一个很奇怪的问题,原来数据操作都是自己代码去完成更新,从来没有涉及到这种方式,所以一时晕菜了。 1 SQLiteDataAdapter dataAdpater = new SQLiteDataAdapter("Select cid,sd from VC", conn); 2 dataAdpater.DeleteCommand = new SQLiteCommand("delete From VC Where cid = @cid", conn); 3 dataAdpater.De 阅读全文
posted @ 2012-01-21 17:27 阿修 阅读(3049) 评论(2) 推荐(3)

摘要:在Hits类里面GetMoreDocs函数中:TopDocs topDocs = (sort == null) ? searcher.Search(weight, filter, n) : searcher.Search(weight, filter, n, sort, GroupField);sort == null:到TopDocCollector处理sort != null:到TopFieldDocCollector处理 阅读全文
posted @ 2011-11-02 12:39 阿修 阅读(277) 评论(0) 推荐(0)

摘要:So, you need to setup a VPN connection to your work/client/buddy's remote network. No problem, just use the Windows VPN client, fill in the remote VPN server IP address, your username and password... click Connect. And a few seconds later you're connected to the remote network and you can no 阅读全文
posted @ 2011-10-13 14:08 阿修 阅读(304) 评论(0) 推荐(0)

摘要:UPX(the Ultimate Packer for eXecutables)是一个非常全面的可执行文件压缩软件,支持dos/exe、dos/com、dos/sys、djgpp2/coff、 watcom/le、win32/pe、rtm32/pe、tmt/adam、atari/tos、linux/i386等几乎所有平台上的可执行文件, 具有极佳的压缩比,还可以对未压缩的文件和压缩完后进行比较。官网站点:http://upx.sourceforge.net/ 阅读全文
posted @ 2011-10-11 14:19 阿修 阅读(1102) 评论(6) 推荐(0)

摘要:Memcached是什么?Memcached是由Danga Interactive开发的,高性能的,分布式的内存对象缓存系统,用于在动态应用中减少数据库负载,提升访问速度。Memcached能缓存什么?通过在内存里维护一个统一的巨大的hash表,Memcached能够用来存储各种格式的数据,包括图像、视频、文件以及数据库检索的结果等。Memcached快么?非常快。Memcached使用了libe... 阅读全文
posted @ 2010-11-26 10:16 阿修 阅读(1363) 评论(1) 推荐(1)

摘要:最近在做一些跨语言的开发,需要C#调用VC++开发的动态链接库,以前对VC++没有太多深入研究,导致这次开发过程遇到了阻碍,下面是从中得到的一些经验。1、Byte vs Char在C#中Byte就8 bit,Char是16bit(2 Byte)。而在VC++中是没有Byte的数据类型,char= signed Char= unsigned char = __int8 长度都是1 Byte。而VC+... 阅读全文
posted @ 2010-06-07 11:32 阿修 阅读(1680) 评论(5) 推荐(0)