Decoder-Konstruktor
Initialisiert eine neue Instanz der Decoder-Klasse.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Protected Sub New
'Usage
Dim instance As New Decoder
protected Decoder ()
protected:
Decoder ()
protected Decoder ()
protected function Decoder ()
Hinweise
Zum Abrufen einer Instanz der Implementierung dieser Klasse verwenden Sie die GetDecoder-Methode einer Encoding-Implementierung.
Beispiel
Das folgende Beispiel veranschaulicht zwei Verfahren zum Initialisieren einer neuen Instanz von Decoder.
Imports System
Imports System.Text
Class EncoderExample
Public Shared Sub Main()
' A Decoder is obtained from an Encoding.
Dim uni As New UnicodeEncoding()
Dim dec1 As Decoder = uni.GetDecoder()
' A more direct technique.
Dim dec2 As Decoder = Encoding.Unicode.GetDecoder()
' dec1 and dec2 seem to be the same.
Console.WriteLine(dec1.ToString())
Console.WriteLine(dec2.ToString())
' Note that their hash codes differ.
Console.WriteLine(dec1.GetHashCode())
Console.WriteLine(dec2.GetHashCode())
End Sub
End Class
using System;
using System.Text;
class EncoderExample {
public static void Main() {
// A Decoder is obtained from an Encoding.
UnicodeEncoding uni = new UnicodeEncoding();
Decoder dec1 = uni.GetDecoder();
// A more direct technique.
Decoder dec2 = Encoding.Unicode.GetDecoder();
// dec1 and dec2 seem to be the same.
Console.WriteLine(dec1.ToString());
Console.WriteLine(dec2.ToString());
// Note that their hash codes differ.
Console.WriteLine(dec1.GetHashCode());
Console.WriteLine(dec2.GetHashCode());
}
}
using namespace System;
using namespace System::Text;
int main()
{
// A Decoder is obtained from an Encoding.
UnicodeEncoding^ uni = gcnew UnicodeEncoding;
Decoder^ dec1 = uni->GetDecoder();
// A more direct technique.
Decoder^ dec2 = Encoding::Unicode->GetDecoder();
// dec1 and dec2 seem to be the same.
Console::WriteLine( dec1 );
Console::WriteLine( dec2 );
// Note that their hash codes differ.
Console::WriteLine( dec1->GetHashCode() );
Console::WriteLine( dec2->GetHashCode() );
}
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0
Siehe auch
Referenz
Decoder-Klasse
Decoder-Member
System.Text-Namespace
Encoding