다음을 통해 공유


VBFixedStringAttribute 클래스

업데이트: 2007년 11월

문자열을 고정 길이인 것처럼 처리해야 함을 나타냅니다.

<System.AttributeUsage(System.AttributeTargets.Field, _
   Inherited := False, AllowMultiple := False)> _
Public NotInheritable Class VBFixedStringAttribute
   Inherits System.Attribute

설명

Visual Basic 문자열은 기본적으로 가변 길이 형식입니다. 이 특성은 고정 길이 문자열을 필요로 하는 FileGet과 FilePut 같은 Visual Basic 파일 입력 및 출력 함수를 사용할 때 유용합니다.

참고:

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는 알림용이며 가변 길이 문자열을 고정 문자열로 변환하는 데 사용할 수 없습니다. 이 특성은 Len 및 FilePut 함수와 같은 VBFixedStringAttribute를 인식하는 메서드 또는 API 호출에서 구조체 및 지역 변수가 아닌 변수의 문자열을 사용하는 방식을 수정하는 데 사용됩니다. 이 특성이 실제 문자열 길이를 변경하지는 않습니다.

스마트 장치 개발자 참고 사항

이 클래스는 지원되지 않습니다.

요구 사항

네임스페이스:Microsoft.VisualBasic

**어셈블리:**Visual Basic 런타임 라이브러리(Microsoft.VisualBasic.dll)

참고 항목

개념

Visual Basic에서 사용되는 특성

참조

VBFixedStringAttribute 클래스 멤버

VBFixedArrayAttribute 클래스

StringBuilder

MarshalAsAttribute

ComClassAttribute 클래스

Len 함수(Visual Basic)

FileGet 함수

FilePut 함수

FileOpen 함수

기타 리소스

Visual Basic의 특성