04 2012 档案

摘要:$(function () { //数据绑定开始 $.ajax({ type: "Post", data: { startdate: "2012-4-1", enddate: "2012-4-29" }, url: "Normal/Service.aspx?Module=Sale_express_cost&Action=GetSaleExpressCost", dataType: "json", success: function (msg) { //数据处理开始 var data = 阅读全文
posted @ 2012-04-29 20:15 szjdw 阅读(251) 评论(0) 推荐(0) 编辑
摘要:大家都知道在sql server中利用for xml path语句能够把查询的数据生成xml数据,下面是他的一些应用实例:DECLARE @TempTable table(UserID int , UserName nvarchar(50));insert into @TempTable (UserID,UserName) values (1,'a')insert into @TempTable (UserID,UserName) values (2,'b')select UserID,UserName from @TempTable FOR XML PATH运 阅读全文
posted @ 2012-04-28 11:42 szjdw 阅读(204) 评论(0) 推荐(0) 编辑
摘要:ado.net2.0 增强了数据提供程序的架构,并引入了工厂类,每个.net数据提供程序包括一个派生于基类DbProviderFactory的工厂类,工厂类表示该提供程序特有的各种服务的入口点。下面列出了一个工厂类的主要方法:CreateCommand 返回一个提供程序特有的命令对象CreateCommandBuilder 返回一个提供程序特有的命令创建者对象CreateConnection 返回一个提供程序特有的连接对象CreateDataAdapter 返回一个提供程序特有的适配器对象CreateParameter返回一个提供程序特有的参数对象如何获得一个特有的数据提供程序的工厂呢?通过使 阅读全文
posted @ 2012-04-24 17:36 szjdw 阅读(373) 评论(0) 推荐(0) 编辑
摘要:模糊查询like的用法如下:sql对like操作中的特殊字符处理方法:sql server查询过程中,单引号'是特殊字符,所以在查询的时候要转换成双单引号''。在like操作还有以下特殊字符:下划线_,百分号%,方括号[],尖号^。其用途如下:_:用于代替一个任意字符(相当于正则表达式中的?)%:用于代替任意数目的任意字符(相当于正则表达式中的*)[]:用于转义(事实上只有左方括号用于转义,右方括号使用最近优先原则匹配最近的左方括号)^:用于排除一些字符进行匹配以下是一些匹配的举例,需要说明的是,只有like操作才有这些特殊字符,=操作是没有的a_b... a[_]%a 阅读全文
posted @ 2012-04-23 18:48 szjdw 阅读(512) 评论(0) 推荐(0) 编辑
摘要:Question:I am using Windbg to disassembly managed code (written in c#,console application) using Windbg's !U command from sos.dll.I find when using !u to disassemble a managed function ,the disassebled IL code only contains function calls i made ,and for remaining parts(non-function call C# code 阅读全文
posted @ 2012-04-21 16:30 szjdw 阅读(203) 评论(0) 推荐(0) 编辑
摘要:AttributeUsage类是一个预定义的属性类,以帮助我们控制自定义属性的使用.也就是我们可以定义自定义属性类的属性.这个类描述了如何使用自定义的属性类.AttributeUsage有三个数据属性可用以修饰我们的自定义的属性.ValidOn 定义了自定义属性在哪些程序实体上可被使用.这个可使用实体列表可通过 AttributeTargets枚举类型的OR操作进行设置AllowMutiple 定义了是否可在同一个程序实体上同时使用多个属性进行修饰Inherited 定义了自定义的修饰是否可由被修饰类的派生类继承 让我们做点具体的吧。我们将会用一个AttributeUsage属性修饰我们的属. 阅读全文
posted @ 2012-04-20 11:14 szjdw 阅读(233) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection.Emit;namespace ConsoleApplication1{ public delegate System.String FeedbackToString(); class Program { static void Main(string[] args) { DynamicMethod dynamicMethod = new DynamicMethod(System.Str 阅读全文
posted @ 2012-04-18 15:12 szjdw 阅读(620) 评论(0) 推荐(0) 编辑
摘要:Look at the MSIL and the native machine code for methods generated through Reflrction.Emit.1,Now let us look at the stack.Execute the command "!clrstack".You'll get the stack pointer and instruction pointer for each frame.The result should look something like this:!clrstackOS Thread Id 阅读全文
posted @ 2012-04-17 22:08 szjdw 阅读(439) 评论(0) 推荐(0) 编辑
摘要:Loads the element containing an object reference at a specified array index onto the top of the evaluation stack as type O(object reference).The stack transitional behavior,in sequential order,is:1,An object reference array is pushed onto the stack;2,An index value index is pushed onto the stack;3,i 阅读全文
posted @ 2012-04-17 14:48 szjdw 阅读(282) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;using System.Reflection.Emit;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { DynamicMethod dynamicMethod = new DynamicMethod("Test",null,new Type[]{typ 阅读全文
posted @ 2012-04-16 11:34 szjdw 阅读(232) 评论(0) 推荐(0) 编辑
摘要:Reflection.Emit的作用是能够在程序运行的时候动态生成Class,Method和Field.这样带来的好处是在程序运行的时候产生DynamicProxy,从而可以达到AOP拦截的作用(就是AOP.NET的实现原理).由于Emit中提供了TypeBuilder(生成Class的类),MethodBuilder(生成Method的类)以及FieldBuilder(生成类的成员变量的类)等等.由于MethodBuilder只能生成函数的申明,不能生成函数的执行代码,所以要想生成一个完整的函数,就不可避免的要用到ILGenerator类.ILGenerator只能通过Emit(...)函数 阅读全文
posted @ 2012-04-14 18:57 szjdw 阅读(290) 评论(0) 推荐(0) 编辑
摘要:开始--运行--cmd 进入命令提示符 输入netstat -ano 即可看到所有连接的PID 之后在任务管理器中找到这个PID所对应的程序如果任务管理器中没有PID这一项,可以在任务管理器中选"查看"-"选择列" 经常,我们在启动应用的时候发现系统需要的端口被别的程序占用,如何知道谁占有了我们需要的端口,很多人都比较头疼,下面就介绍一种非常简单的方法,希望对大家有用 假如我们需要确定谁占用了我们的9050端口 1、Windows平台 在windows命令行窗口下执行: 1.查看所有的端口占用情况C:\>netstat -ano 协议 本地地址 外 阅读全文
posted @ 2012-04-12 21:45 szjdw 阅读(182) 评论(0) 推荐(0) 编辑
摘要:com即组件对象模型,是component object model取前三个字母的缩写,这三个字母在当今Windows的世界中随处可见。随时涌现出来的大把大把的新技术都以com为基础。各种文档中也充斥着诸如com对象、接口、服务器之类的术语。因此,对于一个程序员来说,不仅要掌握使用com的方法,而且还要彻底熟悉com的所有一切。com到底是什么?简单地说,com是一种跨应用和语言共享二进制代码的方法。与C++不同,他提倡源代码重用。ATL便是一个很好的例证。源码级重用虽然好,但只能用于C++.他还带来了名字冲突的可能性,更不用说不断拷贝重用代码而导致工程膨胀和臃肿。windows使用dlls在 阅读全文
posted @ 2012-04-11 18:27 szjdw 阅读(3130) 评论(0) 推荐(0) 编辑
摘要:今天看到博客园一篇文章写抽象类实例化,net framework是ms的,我改不了abstract。但是抽象类是可以做出实例化效果的。为了增强记忆,把代码抄一遍吧!protected sealed override Delegate CombineImp(Delegate follow){ if(base.GetType()!=follow.GetType()) { throw new Exception(); } Delegate delegate2=(MulticastDelegate)((MulticastDelegate)follow).MemberwiseClone()... 阅读全文
posted @ 2012-04-06 19:26 szjdw 阅读(139) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Class1 { static void Main(System.String[] args) { Set.Feedback fb= new Set.Feedback(Class1.FeedbackToConsole); for (System.Int32 i = 0; i < 5;i++ ) { new Set(3).ProcessingItem(fb 阅读全文
posted @ 2012-04-06 11:26 szjdw 阅读(193) 评论(0) 推荐(0) 编辑
摘要:方法一:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Class1 { static void Main(System.String[] args) { for (System.Int32 i = 0; i < 5;i++ ) { new Set(3).ProcessingItem(Class1.FeedbackToConsole); } Console.Read(); } static void 阅读全文
posted @ 2012-04-06 10:51 szjdw 阅读(280) 评论(0) 推荐(0) 编辑
摘要:在方法表中包含了虚方法表,里面包含了一些指向隐藏在类型方法背后的代码的指针。既然虚方法表中包含了指向代码的指针,那么这些方法本身如何自行描叙?这个问题的答案就在与方法描叙符。在方法描叙符中包含了关于方法的详细信息,例如方法的文本表示,他所在的模块,以及实现方法的代码的地址。要找到指定方法的方法描叙符,可以使用扩展命令dumpmt,同时使用开关-md.例如,如果在调试器下运行ConsoleApplication1.exe,并且将局部变量myObject的方法表转存出来(dump),那么可以看到以下内容:!dumpmt -md 00a138ccEEClass: 00a114bcModule: 00 阅读全文
posted @ 2012-04-02 18:11 szjdw 阅读(911) 评论(0) 推荐(0) 编辑