随笔分类 - C#&dotNet开发
摘要:It's more C++ style. Some key basic points: --using namespace XX --NO internal keyword --Organize a class/struct like C++. "Public:", "Private:" --No below keywords which are only for C#: foreach, usi...
阅读全文
摘要:来自 ITPUB AJAX 控件工具包 ASP.NET MVC MVC的架构在现在的Web开发中起着重要的作用,象Ruby on Rails,Zend Framwork等框架都是使用MVC框架进行开发的。多亏有了ASP.NET MVC框架,.NET开发者也能够拥有一个功能强大的MVC框架了。ASP.NET MVC框架提供了MVC的良好分层,测试驱动以及“约定优先”的...
阅读全文
摘要:dotNet Assembly basic (a overall topic Assemblies and the Global Assembly Cache can be found in MSDN)Assemblies have the following properties:Assemblies are implemented as .exe or .dll files.You can s...
阅读全文
摘要:(MSDN)You can use PtrToStringChars in Vcclr.h to convert String to native wchar_t * or char *. This always returns a wide Unicode string pointer because CLR strings are internally Unicode. You can th...
阅读全文
摘要:1. VS project setting regards with platformFor native c++ project, there are debug | win32, debug | x64, release | win32, release | x64 configurations. Note:"debug" / "release" can be renamed while "w...
阅读全文
摘要:.net 支持三种文件类型的resource:.txt .resx .resources system.resources 名字空间支持三种资源文件: .txt 文件,只能有字符串资源。因为不能被嵌入到 assembly 中,所以非常容易暴露,被客户修改。最大缺点是仅支持字符串资源,所以不推荐使用。 .resx 文件,由 xml 组成,能加入所有资源,包括二进制。同样不能被嵌入到 assem...
阅读全文
摘要:ILDASM: MS提供的reflection工具,可以查看.net assembly中的信息。.Net Reflector: 可以做两件事情:reflection--查看.net assembly中的信息;disassembly: 反编译成.cs等类型代码源文件。
阅读全文
摘要:1. Struct与类的区别: (1)结构是值类型,不是引用类型。 (2)结构可以继续接口,但是不可以继承类或结构。 (3)结构的构造方法的工作方式有所不同,只能声明带参数的构造方法,且不能声明析构方法。 (4)可以指定字段如何在内存中布局。(5) 使用。如下两种方法都可以。但是切记:方法一的话,"Users user;" 并没有调用构造函数初始化成员变量!!所以,总起来讲,还是方法二好!以下为M...
阅读全文
摘要:A project's properties specify how a project is built and debugged.About how to build a project, it includes things like stack size, code optimization method, string pooling off/on, virtual address re...
阅读全文
摘要:First of first, one thing we need to know is that C# and CLR (actually C++/CLI) are all EMCA standards now. It means if you want, you can implement your version C# compiler, CLR on other platform. But...
阅读全文
摘要:If you know some C++ STL, you should know that we can pass in a function object when constructing a STL map, set, etc to let the container use that function to do comparison for its elements. Now what...
阅读全文
摘要:Our App is using custom performance counters working with MS perfMon.exe for performance monitoring / logging. So I take a quick look at MSDN about this domain classes for overview.System.Diagnostics ...
阅读全文
摘要:Attention to its rich propertes to read back a XmlNode's content:XmlNode.InnerText: escape all markup and just return the text. XmlNode.InnerXMLXmlNode.OuterXML MSDN example this:
阅读全文
摘要:1. RegexRegex.IsMatchRegex.ReplaceEasy to understand and use. 2. RegexOptionsUse it to specify the options for regular expression matching. This enumeration has a FlagsAttribute attribute that allows ...
阅读全文
摘要:1. How to programatically create a bitmap by filling in existing images.Steps: a. Create an empty bitmap with you wanted size and get graphics from it. b. Create TextureBrushes with intended to fill i...
阅读全文
摘要:Metadata is information about the data -- that is, information about the types, code, assembly, and so forth -- that is stored along with your program.Attributes are a mechanism for adding metadata, s...
阅读全文
摘要:1. Can I use typedefs in C#?No, C# has no direct equivalent of the C++ typedef. C# does allow an alias to be specified via the using keyword:but the alias only applies in the file in which it is decla...
阅读全文
摘要:List<Employee> or EmployeeList? In current versions of C#, to get a strongly-typed collection, you need to define a separate type for that collection. So if you want to expose a collection o...
阅读全文
摘要:1. Duck Typing ("If it walks like a duck and quacks like a duck, it must be a duck.") [Refer to here]Duck typing allows an object to be passed in to a method that expects a certain type even if it do...
阅读全文
摘要:From: Code Project 6 important .NET concepts: - Stack, heap, Value types, reference types, boxing and Unboxing.IntroductionWhat goes inside when you declare a variable?Stack and HeapValue types and re...
阅读全文

浙公网安备 33010602011771号