类库.docx

上传人:b****2 文档编号:18538438 上传时间:2023-08-19 格式:DOCX 页数:34 大小:36.79KB
下载 相关 举报
类库.docx_第1页
第1页 / 共34页
类库.docx_第2页
第2页 / 共34页
类库.docx_第3页
第3页 / 共34页
类库.docx_第4页
第4页 / 共34页
类库.docx_第5页
第5页 / 共34页
类库.docx_第6页
第6页 / 共34页
类库.docx_第7页
第7页 / 共34页
类库.docx_第8页
第8页 / 共34页
类库.docx_第9页
第9页 / 共34页
类库.docx_第10页
第10页 / 共34页
类库.docx_第11页
第11页 / 共34页
类库.docx_第12页
第12页 / 共34页
类库.docx_第13页
第13页 / 共34页
类库.docx_第14页
第14页 / 共34页
类库.docx_第15页
第15页 / 共34页
类库.docx_第16页
第16页 / 共34页
类库.docx_第17页
第17页 / 共34页
类库.docx_第18页
第18页 / 共34页
类库.docx_第19页
第19页 / 共34页
类库.docx_第20页
第20页 / 共34页
亲,该文档总共34页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

类库.docx

《类库.docx》由会员分享,可在线阅读,更多相关《类库.docx(34页珍藏版)》请在冰点文库上搜索。

类库.docx

类库

类库4

用法4

异常4

线程安全4

命名空间4

1、Microsoft.CSharp4

2、Microsoft.JScript13

3、Microsoft.VisualBasic13

4、Microsoft.Vsa13

5、Microsoft.Win3214

6、System14

7、System.CodeDom14

8、System.CodeDom.Compiler14

9、System.Collections14

10、System.Collections.Specialized14

11、System.ComponentModel14

12、System.ComponentModel.Design14

13、System.ComponentModel.Design.Serialization15

14、System.Configuration15

15、System.Configuration.Assemblies15

16、System.Configuration.Install15

17、System.Data15

18、System.Data.Common15

19、System.Data.Odbc15

20、System.Data.OleDb16

21、System.Data.OracleClient16

22、System.Data.SqlClient16

23、System.Data.SqlServerCE16

24、System.Data.SqlTypes16

25、System.Diagnostics16

26、System.Diagnostics.SymbolStore16

27、System.DirectoryServices17

28、System.Drawing17

29、System.Drawing.Design17

30、System.Drawing.Drawing2D17

31、System.Drawing.Imaging17

32、System.Drawing.Printing17

33、System.Drawing.Text17

34、System.EnterpriseServices17

35、System.EnterpriseServices.CompensatingResourceManager18

36、System.EnterpriseServices.Internal18

37、System.Globalization18

38、System.IO18

39、System.IO.IsolatedStorage18

40、System.Management18

41、System.Management.Instrumentation18

42、System.Messaging19

43、System.Net19

44、System.Net.Sockets19

45、System.Reflection19

46、System.Reflection.Emit19

47、System.Resources19

48、System.Runtime.CompilerServices19

49、System.Runtime.InteropServices19

50、System.Runtime.InteropServices.CustomMarshalers20

51、System.Runtime.InteropServices.Expando20

52、System.Runtime.Remoting20

53、System.Runtime.Remoting.Activation20

54、System.Runtime.Remoting.Channels20

55、System.Runtime.Remoting.Channels.Http20

56、System.Runtime.Remoting.Channels.Tcp20

57、System.Runtime.Remoting.Contexts20

58、System.Runtime.Remoting.Lifetime21

59、System.Runtime.Remoting.Messaging21

60、System.Runtime.Remoting.Metadata21

61、System.Runtime.Remoting.Metadata.W3cXsd200121

62、System.Runtime.Remoting.MetadataServices21

63、System.Runtime.Remoting.Proxies21

64、System.Runtime.Remoting.Services21

65、System.Runtime.Serialization22

66、System.Runtime.Serialization.Formatters22

67、System.Runtime.Serialization.Formatters.Binary22

68、System.Runtime.Serialization.Formatters.Soap22

69、System.Security22

70、System.Security.Cryptography22

71、System.Security.Cryptography.X509Certificates22

72、System.Security.Cryptography.XML22

73、System.Security.Permissions23

74、System.Security.Policy23

75、System.Security.Principal23

76、System.ServiceProcess23

77、System.Text23

78、System.Text.RegularExpressions23

79、System.Threading23

80、System.Timers23

81、System.web24

82、System.Web.Caching24

83、System.Web.Configuration24

84、System.Web.Hosting24

85、System.Web.Mail24

86、System.Web.Mobile24

87、System.Web.Security24

88、System.Web.Services24

89、System.Web.Services.Configuration25

90、System.Web.Services.Description25

91、System.Web.Services.Discovery25

92、System.Web.Services.Protocols25

93、System.Web.SessionState25

94、System.Web.UI25

95、System.Web.UI.Design26

96、System.Web.UI.Design.WebControls26

97、System.Web.UI.HtmlControls26

98、System.Web.UI.MobileControls26

99、System.Web.UI.MobileControls.Adapters26

100、System.Web.UI.WebControls26

101、System.Windows.Forms26

102、System.Windows.Forms.Design26

103、System.Xml27

104、System.Xml.Schema27

105、System.Xml.Serialization27

106、System.Xml.XPath27

107、System.Xml.Xsl27

类库

.NETFramework类库是一个由Microsoft.NETFrameworkSDK中包含的类、接口和值类型组成的库。

该库提供对系统功能的访问,是建立.NETFramework应用程序、组件和控件的基础。

用法

可以按语言筛选类库参考文档,以便查看某种语言(VisualBasic、C#、C++的托管扩展或JScript)或者同时查看所有这四种语言的语法、说明和示例。

若要按语言筛选,请单击任一参考页顶部的筛选图标

,然后选择一种语言或选择“全部显示”。

异常

当试图调用实例方法并且基础对象包含空引用时,类库中的所有实例方法都将引发NullReferenceException的实例。

由于任何实例方法都可能发生此异常,参考文档中并没有针对每个实例方法显式列出此异常。

类库文档列出了各成员引发的其他异常,以及对各异常的引发条件的说明。

线程安全

.NETFramework中的所有公共静态成员(方法、属性、字段和事件)都支持在多线程环境下的并发访问。

因此,任何.NETFramework静态成员都可以从两个线程中被同时调用,而不会发生争用条件、死锁或故障。

对于.NETFramework中的所有类和结构,请查看API参考文档中的“线程安全”部分,确定它是否是线程安全的。

如果要在多线程环境下使用非线程安全类,必须使用提供必要的同步构造的代码来包装该类的实例。

命名空间

.NETFramework类库提供下列命名空间:

1、Microsoft.CSharp

包含支持用C#语言进行编译和代码生成的类。

Microsoft.CSharp层次结构

System.Object

   Microsoft.CSharp.Compiler

   Microsoft.CSharp.CompilerError

   System.MarshalByRefObject

      System.ComponentModel.Component

         System.CodeDom.Compiler.CodeDomProvider

            Microsoft.CSharp.CSharpCodeProvider

   System.ValueType

      System.Enum

         Microsoft.CSharp.ErrorLevel

Compiler类

编译器的托管包装。

有关此类型所有成员的列表,请参阅Compiler成员。

System.Object

   Microsoft.CSharp.Compiler

[Visual Basic]

PublicClassCompiler

[C#]

publicclassCompiler

[C++]

public__gcclassCompiler

[JScript]

publicclassCompiler

线程安全

此类型的所有公共静态(VisualBasic中为Shared)成员对多线程操作而言都是安全的。

但不保证任何实例成员是线程安全的。

备注

若要在进程内编译C#代码,请调用Compile。

要求

命名空间:

 Microsoft.CSharp

平台:

 Windows 98,Windows NT 4.0,Windows ME,Windows 2000,Windows XP Home Edition,Windows XP Professional,Windows Server 2003 系列

程序集:

 Cscompmgd(在Cscompmgd.dll中)

Compiler成员

公共方法

Compile

将给定的C#源编译到指定的目标文件。

Equals(从Object继承)

已重载。

确定两个Object实例是否相等。

GetHashCode(从Object继承)

用作特定类型的哈希函数,适合在哈希算法和数据结构(如哈希表)中使用。

GetType(从Object继承)

获取当前实例的Type。

ToString(从Object继承)

返回表示当前Object的String。

受保护的方法

Finalize(从Object继承)

已重写。

允许Object在“垃圾回收”回收Object之前尝试释放资源并执行其他清理操作。

在C#和C++中,使用析构函数语法来表示终结程序。

MemberwiseClone(从Object继承)

创建当前Object的浅表副本。

●Compiler.Compile方法

将给定的C#源编译到指定的目标文件。

[Visual Basic]

PublicSharedFunctionCompile(_

ByValsourceTexts()AsString,_

ByValsourceTextNames()AsString,_

ByValtargetAsString,_

ByValimports()AsString,_

ByValoptionsAsIDictionary_

)AsCompilerError()

[C#]

publicstaticCompilerError[]Compile(

string[]sourceTexts,

string[]sourceTextNames,

stringtarget,

string[]imports,

IDictionaryoptions

);

[C++]

public:

staticCompilerError*Compile(

String*sourceTexts__gc[],

String*sourceTextNames__gc[],

String*target,

String*imports__gc[],

IDictionary*options

)[];

[JScript]

publicstaticfunctionCompile(

sourceTexts:

String[],

sourceTextNames:

String[],

target:

String,

imports:

String[],

options:

IDictionary

):

CompilerError[];

参数

sourceTexts

一个string类型的数组,组成数组的每一项都带有C#代码。

每个字符串都等效于一个源文件。

至少要有一个sourceText元素。

sourceTextNames

一个string类型的数组,它包含每个sourceText的文件名。

这些文件名用于编译器的诊断和调试信息。

此数组是必需的,但可以使用#line指令进行本地重写。

此数组的元素数必须与sourceTexts参数相同。

target

输出文件名。

此参数必须有。

imports

一个string类型的数组(带有要引用的文件)。

它与/reference(导入元数据)编译器选项的效果相同。

该参数可以为空引用(VisualBasic中为Nothing)。

options

编译器选项的IDictionary。

关键字是编译器选项的缩写。

值为选项所需的值。

该参数可以为空引用(VisualBasic中为Nothing)。

请注意,并非所有的C#编译器选项都可识别。

可识别的选项和值:

关键字名称

用法

addmodule

要包含在此程序集内的模块列表。

模块名必须用竖线或管道字符分隔。

值的类型必须是String。

请参见“/addmodule(导入元数据)”

baseaddress

库的基址。

值的类型必须是UInt32。

请参见“/baseaddress(指定DLL的基址)”

bugreport

产生错误报告文件。

值的类型必须是String。

请参见“/bugreport(报告问题)”

checked

设置默认表达式计算为选中(或未选中)。

值的类型必须是Boolean。

请参见“/checked(检查整数算法)”

d

要定义的、以分号分隔的符号列表。

值的类型必须是String。

请参见“/define(预处理器定义)”

debug

随输出发出调试信息。

值的类型必须是Boolean。

不能指定Full或pdbonly。

请参见“/debug(发出调试信息)”

doc

要乘纳XML注释的文件名。

值的类型必须是String。

请参见“/doc(处理文档注释)”

filealign

PE部分的对齐尺寸。

值的类型必须是UInt32。

请参见“/filealign(指定节对齐)”

incr

启用增量重新生成。

值的类型必须是Boolean。

请参见“/incremental(启用增量编译)”

lib

查找模块和引用的程序集时要搜索的附加路径。

值的类型必须是String。

请参见“/lib(指定程序集引用位置)”

linkres

将托管资源链接到程序集。

值的类型必须是String。

请参见“/linkresource(链接到.NETFramework资源)”

m

搜索Main方法时所采用的类型。

值的类型必须是String。

请参见“/main(指定Main方法的位置)”

nostdlib

不自动引用mscorlib.dll。

值的类型必须是Boolean。

请参见“/nostdlib(不导入标准库)”

nowarn

不进行报告的、用分号分隔的警告编号列表。

值的类型必须是String。

请参见“/nowarn(取消指定警告)”

o

启用编译器优化。

值的类型必须是Boolean。

请参见“/optimize(启用/禁用优化)”

r

引用的程序集。

值的类型必须是String。

如果指定了不止一个程序集,则必须用竖线或管道字符分隔文件名。

请参见“/reference(导入元数据)”

res

嵌入托管资源。

值的类型必须是String。

请参见“/resource(将资源文件嵌入输出文件中)”

target

输出文件的目标类型,为下列类型之一:

“library”、“exe”、“winexe”或“module”。

值的类型必须是String。

请参见“/target(指定输出文件格式)”

unsafe

允许不安全构造。

值的类型必须是Boolean。

请参见“/unsafe(启用不安全模式)”

w

警告等级(0-4)。

值的类型必须是String。

请参见“/warn(指定警告等级)”

warnaserror

将警告诊断报告为错误。

值的类型必须是Boolean。

请参见“/warnaserror(将警告视为错误)”

win32icon

自动生成的Win32资源的Win32图标。

值的类型必须是String。

请参见“/win32icon(导入.ico文件)”

win32res

Win32资源文件。

值的类型必须是String。

请参见“/win32res(导入Win32资源文件)”

返回值

将诊断消息以一个CompilerError类型数组的形式返回。

如果该数组为空或所有元素都为警告,则编译成功。

异常

异常类型

条件

ArgumentNullException

sourceTexts为空引用(VisualBasic中为Nothing)。

-或-

sourceTextNames为空引用(Nothing)。

-或-

target为空引用(Nothing)。

ArgumentOutOfRangeException

sourceTexts为空数组。

-或-

sourceTextNames与sourceText的大小不同。

要求

平台:

 Windows 98,Windows NT 4.0,Windows ME,Windows 2000,Windows XP Home Edition,Windows XP Professional,Windows Server 2003 系列

.NETFramework安全性:

 

∙对直接调用方完全信任。

部分受信任的代码不能使用此成员。

有关更多信息,请参阅在部分受信任的代码中使用库

●Object.Equals方法

确定两个Object实例是否相等。

重载列表

确定指定的Object是否等于当前的Object。

受.NETFramework精简版的支持。

[Visual Basic]OverloadsPublicOverridableFunctionEquals(Object)AsBoolean

[C#]publicvirtualboolEquals(object);

[C++]public:

virtualboolEquals(Object*);

[JScript]publicfunctionEquals(Object):

Boolean;

确定指定的Object实例是否被视为相等。

[Visual Basic]OverloadsPublicSharedFunctionEquals(Object,Object)AsBoolean

[C#]publicstaticboolEquals(object,object);

[C++]public:

staticboolEquals(Object*,Object*);

[JScript]publicstaticfunctionEquals(Object,Object):

Boolean;

示例

[C#, JScript]下面的代码示例比较不同的对象。

[C#, JScript]注意   此示例显示如何使用Equals的一个重载版本。

有关其他可用示例,请参阅单独的重载主题。

[C#]

usingSystem;

publicclassMyClass{

publicstaticvoidMain(){

strings1="Tom";

strings2="Carol";

Console.WriteLine("Object.Equals(\"{0}\",\"{1}\")=>{2

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2