随笔分类 - C#
摘要:以下代码为跟踪的方法 usingSystem.Diagnostics; namespaceLegalsoft.Kernal.Utility { publicclassLogUtility { //侦听器 privatestaticTextWriterTraceListenerlistner=null; //输出跟踪文件 privateconststringTRACE_FILE="c:\\trace...
阅读全文
摘要:C#里事件订阅的一个小例子using System;using System.Collections.Generic;using System.Text;using System.Threading;using System.Runtime.Remoting.Messaging;using System.IO;using System.Net;namespace ConsoleApplicatio...
阅读全文
摘要:1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int...
阅读全文
摘要:在"实体类代码生成器3"中,用户可以使用C#代码来动态生成一些参数,比如代码类名生成规则,表名生成规则,初始化规则等.而要调用这些代码显然需要对代码进行运行时动态编译,幸好C#有了"万能"的反射系统,可以让我们轻松动态编译代码并调用.OK,现在详细了解下"实体类代码生成器"中的动态编译类,首先定义一个RunnerMethod对象,用来保存和方法有关的信息:C#代码 usingSystem; usi...
阅读全文

浙公网安备 33010602011771号