VBFixedStringAttribute クラス

定義

文字列を固定長であるかのように処理することを示します。

public ref class VBFixedStringAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=false, Inherited=false)]
public sealed class VBFixedStringAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=false, Inherited=false)>]
type VBFixedStringAttribute = class
    inherit Attribute
Public NotInheritable Class VBFixedStringAttribute
Inherits Attribute
継承
VBFixedStringAttribute
属性

Structure Person
    Public ID As Integer
    Public MonthlySalary As Decimal
    Public LastReviewDate As Long
    <VBFixedString(15)> Public FirstName As String
    <VBFixedString(15)> Public LastName As String
    <VBFixedString(15)> Public Title As String
    <VBFixedString(150)> Public ReviewComments As String
End Structure

注意

VBFixedStringAttributeは情報であり、可変長文字列を固定文字列に変換するために使用することはできません。 この属性の目的は、 を認識するメソッドまたは API 呼び出しで構造体と非ローカル変数の文字列がどのように使用されるかを VBFixedStringAttribute変更することです。 この属性は、文字列自体の実際の長さを変更しないことに注意してください。

注釈

Visual Basic の文字列は、既定では可変長です。 この属性は、固定長文字列を必要とする などの FileGetFilePut Visual Basic ファイルの入力および出力関数を使用する場合に便利です。

コンストラクター

VBFixedStringAttribute(Int32)

SizeConst フィールドの値を初期化します。

プロパティ

Length

文字列の長さを取得します。

TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)

メソッド

Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象

こちらもご覧ください