Decoder Конструктор
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Инициализирует новый экземпляр класса Decoder.
protected:
Decoder();
protected Decoder();
Protected Sub New ()
Примеры
В следующем примере демонстрируются два метода инициализации нового Decoder экземпляра.
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() );
}
/* This code example produces the following output.
System.Text.UnicodeEncoding+Decoder
System.Text.UnicodeEncoding+Decoder
54267293
18643596
*/
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());
}
}
/* This code example produces the following output.
System.Text.UnicodeEncoding+Decoder
System.Text.UnicodeEncoding+Decoder
58225482
54267293
*/
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
'This code example produces the following output.
'System.Text.UnicodeEncoding+Decoder
'System.Text.UnicodeEncoding+Decoder
'58225482
'54267293
'
Комментарии
Чтобы получить экземпляр реализации этого класса, приложение должно использовать GetDecoder метод Encoding реализации.
Применяется к
См. также раздел
GitHub сайтында бізбен бірлесіп жұмыс істеу
Бұл мазмұнның көзін GitHub сайтында табуға болады. Онда сонымен бірге мәселелер мен өзгертулерді енгізу сұрауларын жасауға және қарап шығуға болады. Қосымша ақпарат алу үшін қатысушы нұсқаулығын қараңыз.