c# 条件编译 Conditional ("DEBUG")简而言之:可以通
GAC TIPSht
第一章 概述 规范制定原则 1 方便代码的交流和维护。 2 不影响编码的效率,不与大众习惯冲突。 3 使代码更美观、阅读更方便。 4 使代码的逻辑更清晰、更易于理解。 术语定义 Pascal 大小写 将标识符的首字母和后面连
gramming Language, 4th edition by Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth and Peter GoldeEssential C# 4.0 b
using语句之-释放资源和异常处理 2009-05-23 14:04 有时,代码要求非托管资源,如文
倾向
将c#代码转成 c++ 代码时,遇
Different ways how to escape an XML string in C#/XML document. If you d
//z 2012-6-19 14:38:56 PM IS21
Version NameVersion Number[1]Release DateMainstre
<!--span {font-family:'YaHei Consolas H color:#0000F
nyone can explain the major use of MarshalByRefObjectWhat's the purpose for MarshalByRefObject?1. Remoting; it means that bet
将输入字符串转化为合法的文件名称 using System; using System.Text; namespace ConvertFilenameToValid { //z 2012-3-5 13:17:35 PM IS2120@ class Program { static void PrintUsage () {
使用 string 的一些规则 · Use overloads that explicitly specify the stringcomparison rules for string operations. Typically, this involves calling amethod overl
c# 枚举 enum 类型 (IS2120 1. 最平常的方法 public enum Suits { Spades, Hearts, Clubs, Diamonds, NumSuits } public void PrintAllSuits() { foreach(string
string 最佳实践(C#版)1. 总是初始化string1.1 其是一个reftypestring str; //z nullstring str = string
c# Foreach last //z 2012-09-06 15:49:01 IS2120@T2414191273[T14,L128,R4,V138] If you just need to do something with the last element (as opposed to something different with the last element then using
IS2120@BG57IV3 //z 2012-12-18 15:54:31 IS2120@BG57IV3.T2699848562.K[T1,L45,R1,V5] Try out: 1) Exception Reporter http://www.codeplex.com/ExceptionReporter 2) Bug Trap http://www.codeproject.com/KB/ap
#region R#.1 @.net中的隐式、显式转换以及as、is操作符 //z 2012-07-16 14:22:19 @IS2120.T2169364049[T1,L65,R1,V259] 1. System.Object 在.net中,每一个对象最终都会派生自System.Object类型,这意味着下面两种类型定义事实上是一样的: class IS2120
标题KB944899(//z 2012-09-05 14:04:45 IS2120@c.T2123831814[T5,L86,R3,V28])发布日期2008/1/14大小3.41 MB版本Hotfix类别内部版本里程碑描述FIX: This hotfix addresses a performance problem when stepping through Source Cod
1. 十六进制和十进制的相互转换//z 20
//z 2012-11-28 14:34:06 IS2120@BG57IV3.T3337916209.K[T34,L365,R14,V313] 1. 遇到一个奇怪的问题: First-chance exception at 0x74d8c41f Microsoft C++ exception: EEResourceException at memo
//z 主要用于记录一些工具编译:ilspy 一个开放源代码的.NET程序集浏览器和反编译
C# PERFORMANCE 性能 1. 最重要的是定位出 hot spot 尽量优化哪些占用了大量时间的方法等,否则费了力气,效果不彰。2. class 一般不要有空的 dtor 结构无法定义dtor,只有类可以 每一个类只可以有一个dtor dtor不能继承或是重载 不可直接调用;只能由系统(clr?)自动调用 不可有modifiers或是任何的参数 一个dtor
异常的开销: 1. static cost:managed exceptions相对代价较低(与c++相比)。 static cost所发生的地方: 1.1.try/finally/catch/throw这些代码构件实际所在的位置; 1.2. unmanaged code中一旦有了这些构件(使用异常),代码要做大量隐式的工作(比如记录下所有对象,以在异常发生时进行析构),有大量隐式清
int a = 12345678; //格式为sring输出// Label1.Text = string.Format("asdfadsf{0}adsfasdf",a);// Label2.Text = "asdfadsf"+a.ToString()
//z 2012-5-3 16:51:44 PM IS2120@CSDN 如果欲修改值,打开时如下:// Regist
使用xpo(devexpress)时动态创建一个持久化类。这样方便访问数据库。/*使用DevExpress 控件 xpoXPObject 持
c# windows form 生命周期 (Life cycle) 事件 顺序 窗口 初始化 ____________________________________________________________________________________________________________________ 微软官方的文档: form 打开: • &nbs
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号