Marshal.SystemDefaultCharSize 字段

定义

表示系统上的默认字符大小;对于 Unicode 系统,默认值为 2,ANSI 系统为 1。 此字段是只读的。

public: static initonly int SystemDefaultCharSize;
public static readonly int SystemDefaultCharSize;
 staticval mutable SystemDefaultCharSize : int
Public Shared ReadOnly SystemDefaultCharSize As Integer 

字段值

示例

以下示例演示了该 SystemDefaultCharSize 字段。 该代码示例是 Marshal 类中的一个较大示例的一部分。

// Demonstrate the use of public static fields of the Marshal
// class.
Console::WriteLine(
    "SystemDefaultCharSize={0},SystemMaxDBCSCharSize={1}",
    Marshal::SystemDefaultCharSize,
    Marshal::SystemMaxDBCSCharSize);
// Demonstrate the use of public static fields of the Marshal class.
Console.WriteLine("SystemDefaultCharSize={0}, SystemMaxDBCSCharSize={1}",
    Marshal.SystemDefaultCharSize, Marshal.SystemMaxDBCSCharSize);
' Demonstrate the use of public static fields of the Marshal class.
Console.WriteLine("SystemDefaultCharSize={0}, SystemMaxDBCSCharSize={1}", Marshal.SystemDefaultCharSize, Marshal.SystemMaxDBCSCharSize)

适用于

另请参阅