摘要: 第一印象,C#关于线程同步的东西好多,保持了C#一贯的大杂烩和四不象风格(Java/Delphi)。临界区跟Java差不多只不过关键字用lock替代了synchronized,然后又用Moniter的Wait/Pulse取代了Object的Wait/Notify,另外又搞出来几个Event……让人甚是不明了。不管那么多,一个一个来吧。临界区(Critical Section) 是一段在同一时候只被一个线程进入/执行的代码。为啥要有这个东西?是因为这段代码访问了“临界资源”,而这种资源只能同时被互斥地访问。举个例子来说,你的银行账户就是一个互斥资源,一个银行系统里面改变余额(存取)的操作代码.. 阅读全文
posted @ 2011-12-09 15:30 supperwu 阅读(640) 评论(0) 推荐(0) 编辑
摘要: -- ================================================-- Template generated from Template Explorer using:-- Create Multi-Statement Function (New Menu).SQL---- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below.---- This block of comments wi 阅读全文
posted @ 2011-11-22 11:08 supperwu 阅读(325) 评论(0) 推荐(0) 编辑
摘要: LEN:返回指定字符串表达式的字符(而不是字节)数,其中不包含尾随空格。DATALENGTH:返回用于表示任何表达式的字节数。示例1:(相同,返回结果都为5):selectLEN('sssss')selectDATALENGTH('sssss')示例2:(不相同,DATALENGTH是LEN的两倍):selectLEN(N'sssss')selectDATALENGTH(N'sssss')示例3:(不相同,DATALENGTH是LEN的两倍多,由于LEN计算时不包含尾空格):selectLEN(N'sssss')s 阅读全文
posted @ 2011-11-22 11:02 supperwu 阅读(9626) 评论(1) 推荐(0) 编辑
摘要: LINQ提供了方便的语法和很多操作对象集合的有用的方法。但是,要让LINQ比较方法,如Distinct或Intersect能正确处理,类型必须要满足一些条件。让我们看看Distinct方法,它从集合中返回所有的不重复对象。List<int> numbers =newList<int> { 1, 1, 2, 3 };vardistinctNumbers = numbers.D... 阅读全文
posted @ 2010-03-06 23:56 supperwu 阅读(1495) 评论(0) 推荐(0) 编辑
摘要: 原文链接:Page Events: Order and PostBack作者:Paul Wilson翻译:木野狐初始化(Initialization)页面被请求时,第一个被执行的总是构造函数(constructor). 你可以在这里初始化很多自定义属性或对象。不过这里有一些限制,因为 page 还没有被完全初始化。特别地,你必须使用 HttpContext.Current 来访问 QueryStr... 阅读全文
posted @ 2010-02-01 23:59 supperwu 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Using the TagBuilder Class to Create HTML Helpers (C#)The ASP.NET MVC framework includes a useful utility class named the TagBuilder class that you can use when building HTML helpers. The TagBuilder c... 阅读全文
posted @ 2009-12-22 23:04 supperwu 阅读(5524) 评论(0) 推荐(5) 编辑
摘要: Displaying a Table of Database Data The goal of this tutorial is to explain how you can display an HTML table of database data in an ASP.NET MVC application. First, you learn how to use the scaffoldin... 阅读全文
posted @ 2009-12-15 21:52 supperwu 阅读(5152) 评论(0) 推荐(0) 编辑
摘要: Creating Custom HTML HelpersThe goal of this tutorial is to demonstrate how you can create custom HTML Helpers that you can use within your MVC views. By taking advantage of HTML Helpers, you can redu... 阅读全文
posted @ 2009-12-15 00:15 supperwu 阅读(751) 评论(0) 推荐(0) 编辑
摘要: ASP.NET MVC View Overview (C#)The purpose of this tutorial is to provide you with a brief introduction to ASP.NET MVC views, view data, and HTML Helpers. By the end of this tutorial, you should unders... 阅读全文
posted @ 2009-12-14 17:28 supperwu 阅读(400) 评论(0) 推荐(1) 编辑