英語で読む

次の方法で共有


TypeBuilder.DefineInitializedData(String, Byte[], FieldAttributes) メソッド

定義

ポータブル実行可能 (PE) ファイルの .sdata セクションの初期化済みデータ フィールドを定義します。

C#
public System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, byte[] data, System.Reflection.FieldAttributes attributes);

パラメーター

name
String

データを参照するために使用する名前。 name に埋め込み null 値を含めることはできません。

data
Byte[]

データの blob。

attributes
FieldAttributes

フィールドの属性。

戻り値

データを参照するフィールド。

例外

name の長さが 0 です。

- または -

データのサイズが、0 以下か、0x3f0000 以上です。

name または datanull です。

CreateType() は以前に呼び出されています。

注釈

パラメーターに を含FieldAttributes.Staticめなくても、このメソッドで作成するフィールドは staticになりますattributes

適用対象

製品 バージョン
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1