1.设置环境变量: path =C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2.helloworld.cs 第一个程序
namespace InsideCSharp
{
class HelloWorldConsoleApp
{
static void Main()
{
System.Console.WriteLine("hello,world");
}
}
}
cmd--> csc helloworld.cs -->helloworld.exe
namespace 可以嵌套
被引用时用 using A; 但是当引用多个名称空间时,类不能有歧义。可以完全限定。
3。了解底层代码MSIL
用dumpbin.exe实用程序查看(^^据说业界都用这个看二进制代码的内部)(在C:\Program Files\Microsoft Visual Studio 8\VC\bin下)
CMD-->dumpbin /HEADERS /CLRHEADER helloworld.exe
//*******************************ji
E:\study\2006\c#>dumpbin /headers /clrheader helloworld.exe
Microsoft (R) COFF Binary File Dumper Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
DUMPBIN : warning LNK4044: unrecognized option "clrheader"; ignored
Dump of file helloworld.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
14C machine (i386)
3 number of sections
44708882 time date stamp Sun May 21 23:34:26 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
10E characteristics
Executable
Line numbers stripped
Symbols stripped
32 bit word machine
OPTIONAL HEADER VALUES
10B magic # //表明确实是一个合法的PE
8.00 linker version
400 size of code
600 size of initialized data
0 size of uninitialized data
234E RVA of entry point
2000 base of code
4000 base of data
400000 image base
2000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
8000 size of image
200 size of headers
0 checksum
3 subsystem (Windows CUI)
400 DLL characteristics
RESERVED - UNKNOWN
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
0 [ 0] RVA [size] of Export Directory
2300 [ 4B] RVA [size] of Import Directory
4000 [ 2B0] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
6000 [ C] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Special Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
2000 [ 8] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
2008 [ 48] RVA [size] of Reserved Directory
0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1
.text name
354 virtual size
2000 virtual address
400 size of raw data
200 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read
SECTION HEADER #2
.rsrc name
2B0 virtual size
4000 virtual address
400 size of raw data
600 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
SECTION HEADER #3
.reloc name
C virtual size
6000 virtual address
200 size of raw data
A00 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only
Summary
2000 .reloc
2000 .rsrc
2000 .text
//********************************
为了研究c#和.net元素如何实现,用Framework SDK中的反汇编工具,ILDASM.
(ildasm.exe: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin)
其他还有配件(assembly),模块,构建配件,创建共享配件,使用全局配件缓存等内容,在此不再祥述^^
分享到:
相关推荐
学习C#时的一些读书笔记,比较零散,有图,仅供参考。
c#集合的学习 读书笔记 学习心得 介绍得深入浅出,适合各个层次的学者
精心搜集整理的读书笔记,深入浅出,带有实例,适合各种层次的学习者,尤其适合c#初学者。
C#从入门到精通 学习笔记,减少读书的时间,更高效的学习
关于C#语言的学习(主要是方法,继承,重载,属性,索引指示器等等的实例和解释说明)
本文档是学习最新《C#高级编程》第七版的读书笔记,对于一些资源参考了网络相关文章。本文 档仅供个人学习,不可用于商业行为.
这是针对我学习C#用书--21天学通C#的一个读书笔记,希望能够帮助大家快速上手
c#接口的意义 学习心得 读书笔记 (彻底弄清楚接口,轻松使用接口) c#接口的意义 学习心得 读书笔记 (彻底弄清楚接口,轻松使用接口)
Redis,即远程字典服务,是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。...本文适合Redis初学者和进阶者阅读,是一份全面而实用的学习笔记。
《C#与.NET3.0高级程序设计》读书笔记.doc 21天学通c# - C#入门经典.pdf C#核心概念.doc C#基础知识.doc C#入门经典学习笔记.docx
c#中的委托与事件把委托事件讲透 读书笔记 学习心得 经典中的经典,彻底弄清楚委托事件,明白他们的本质,并有适合的例子说明
笔者对这本书阅读完这本书后对这本书中的50条建议较为精华的结论进行整理,方便自己学习的同时分享出来,这是自己在发布文章之前导出的md笔记,也分享出来方便各位大佬有不同的意见可以进行修改, 希望可以对各位...
本文档是学习最新《C#高级编程》第七版的读书笔记,对于一些资源参考了网络相关文章。本文 档仅供个人学习,不可用于商业行为.
本文档是学习最新《C#高级编程》第七版的读书笔记,对于一些资源参考了网络相关文章。本文 档仅供个人学习,不可用于商业行为.
读书笔记,总结适合初学者,望各位支持,谢谢!
帮助学习编程语言,它是学习过程中遇到的需要记忆的东西。
供有其他语言编程基础人员阅读的的C#学习笔记,让你10分钟掌握C#
本文档是学习最新《C#高级编程》第七版的读书笔记,对于一些资源参考了网络相关文章。本文 档仅供个人学习,不可用于商业行为.
本文档是学习最新《C#高级编程》第七版的读书笔记,对于一些资源参考了网络相关文章。本文 档仅供个人学习,不可用于商业行为.