Table of Contents

Class FixedStringAttribute

Namespace
MAS.Communication
Assembly
MAS.Communication.dll

固定长度字符串字段特性(按字节长度)

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class FixedStringAttribute : Attribute
Inheritance
FixedStringAttribute
Inherited Members

Constructors

FixedStringAttribute(int)

固定长度字符串字段特性(按字节长度)

public FixedStringAttribute(int length)

Parameters

length int

Properties

EncodingName

获取或设置编码方式

public string EncodingName { get; set; }

Property Value

string

Remarks

默认值: "ASCII"

Length

获取字符串字节长度

public int Length { get; }

Property Value

int

PaddingChar

获取或设置填充字符

public char PaddingChar { get; set; }

Property Value

char

Remarks

默认值: '\0'

TrimEndPadding

获取或设置是否去除末尾填充

public bool TrimEndPadding { get; set; }

Property Value

bool

Remarks

默认值: true