共用方式為


ILGenerator.EmitWriteLine Method (FieldInfo)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Emits the Microsoft intermediate language (MSIL) necessary to call Console.WriteLine with the given field.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overridable Sub EmitWriteLine ( _
    fld As FieldInfo _
)
public virtual void EmitWriteLine(
    FieldInfo fld
)

Parameters

Exceptions

Exception Condition
ArgumentException

There is no overload of the Console.WriteLine method that accepts the type of the specified field.

ArgumentNullException

fld is nulla null reference (Nothing in Visual Basic).

NotSupportedException

The type of the field is TypeBuilder or EnumBuilder, which are not supported.

Remarks

In Silverlight-based applications, there is no practical use for the EmitWriteLine method.

The type of fld must match the parameter type of an overload of the Console.WriteLine method.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.