CryptographicException Oluşturucular

Tanım

CryptographicException sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

CryptographicException()

Sınıfın CryptographicException yeni bir örneğini varsayılan özelliklerle başlatır.

CryptographicException(Int32)

Belirtilen HRESULT hata koduyla sınıfının yeni bir örneğini CryptographicException başlatır.

CryptographicException(String)

Belirtilen hata iletisiyle sınıfının yeni bir örneğini CryptographicException başlatır.

CryptographicException(SerializationInfo, StreamingContext)
Geçersiz.

CryptographicException sınıfının yeni bir örneğini serileştirilmiş verilerle başlatır.

CryptographicException(String, Exception)

Sınıfın CryptographicException yeni bir örneğini belirtilen bir hata iletisiyle ve bu özel durumun nedeni olan iç özel duruma başvuruyla başlatır.

CryptographicException(String, String)

Belirtilen biçimde belirtilen bir hata iletisiyle sınıfının yeni bir örneğini CryptographicException başlatır.

CryptographicException()

Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs

Sınıfın CryptographicException yeni bir örneğini varsayılan özelliklerle başlatır.

public:
 CryptographicException();
public CryptographicException ();
Public Sub New ()

Örnekler

Aşağıdaki kod örneği, parametresiz bir CryptographicException oluşturma işlemini gösterir. Bu kod örneği, sınıfı için CryptographicException sağlanan daha büyük bir örneğin parçasıdır.

CryptographicException^ cryptographicException = gcnew CryptographicException;
CryptographicException cryptographicException =
    new CryptographicException();
Dim cryptographicException As New CryptographicException

Açıklamalar

Aşağıdaki tablo, CryptographicException öğesinin bir örneği için başlangıç özellik değerlerini gösterir.

Özellik Değer
InnerException null.
Message Yerelleştirilmiş hata ileti dizesi.

Şunlara uygulanır

CryptographicException(Int32)

Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs

Belirtilen HRESULT hata koduyla sınıfının yeni bir örneğini CryptographicException başlatır.

public:
 CryptographicException(int hr);
public CryptographicException (int hr);
new System.Security.Cryptography.CryptographicException : int -> System.Security.Cryptography.CryptographicException
Public Sub New (hr As Integer)

Parametreler

hr
Int32

Hata HRESULT kodu.

Örnekler

Aşağıdaki kod örneği, için CryptographicUnexpectedOperationExceptionbir CryptographicException hata kodu kullanarak oluşturma işlemini gösterir. Bu kod örneği, sınıfı için CryptographicException sağlanan daha büyük bir örneğin parçasıdır.

int exceptionNumber = (int)0x80131431;
CryptographicException^ cryptographicException = gcnew CryptographicException( exceptionNumber );
int exceptionNumber = unchecked((int)0x80131431);
CryptographicException cryptographicException =
    new CryptographicException(exceptionNumber);
Dim exceptionNumber As Integer = &H80131431
Dim cryptographicException As _
    New CryptographicException(exceptionNumber)

Açıklamalar

CryptographicException Oluşturucu bir sistem HRESULT hata kodunu kabul eder ve özelliğini öğesine karşılık gelen yerelleştirilmiş bir iletiye HRESULTayarlarMessage.

Aşağıdaki tablo, CryptographicException öğesinin bir örneği için başlangıç özellik değerlerini gösterir.

Özellik Değer
InnerException null.
Message Yerelleştirilmiş hata ileti dizesi.

Şunlara uygulanır

CryptographicException(String)

Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs

Belirtilen hata iletisiyle sınıfının yeni bir örneğini CryptographicException başlatır.

public:
 CryptographicException(System::String ^ message);
public CryptographicException (string? message);
public CryptographicException (string message);
new System.Security.Cryptography.CryptographicException : string -> System.Security.Cryptography.CryptographicException
Public Sub New (message As String)

Parametreler

message
String

Özel durumun nedenini açıklayan hata iletisi.

Örnekler

Aşağıdaki kod örneği, özel bir hata iletisi kullanarak oluşturma CryptographicException işlemini gösterir. Bu kod örneği, sınıfı için CryptographicException sağlanan daha büyük bir örneğin parçasıdır.

String^ errorMessage = (L"Unexpected Operation exception.");
CryptographicException^ cryptographicException = gcnew CryptographicException( errorMessage );
string errorMessage = ("Unexpected Operation exception.");
CryptographicException cryptographicException =
    new CryptographicException(errorMessage);
Dim errorMessage As String = "Unexpected Operation exception."
Dim cryptographicException As New CryptographicException(errorMessage)

Açıklamalar

Aşağıdaki tablo, CryptographicException öğesinin bir örneği için başlangıç özellik değerlerini gösterir.

Özellik Değer
InnerException null.
Message Hata iletisi dizesi.

Şunlara uygulanır

CryptographicException(SerializationInfo, StreamingContext)

Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs

Dikkat

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

CryptographicException sınıfının yeni bir örneğini serileştirilmiş verilerle başlatır.

protected:
 CryptographicException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected CryptographicException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected CryptographicException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Security.Cryptography.CryptographicException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.CryptographicException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.CryptographicException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.CryptographicException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parametreler

info
SerializationInfo

Serileştirilmiş nesne verilerini tutan nesne.

context
StreamingContext

Kaynak veya hedefle ilgili bağlamsal bilgi.

Öznitelikler

Açıklamalar

Bu oluşturucu, bir akış üzerinden iletilen özel durum nesnesini yeniden oluşturmak için seri durumundan çıkarma sırasında çağrılır.

Şunlara uygulanır

CryptographicException(String, Exception)

Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs

Sınıfın CryptographicException yeni bir örneğini belirtilen bir hata iletisiyle ve bu özel durumun nedeni olan iç özel duruma başvuruyla başlatır.

public:
 CryptographicException(System::String ^ message, Exception ^ inner);
public CryptographicException (string? message, Exception? inner);
public CryptographicException (string message, Exception inner);
new System.Security.Cryptography.CryptographicException : string * Exception -> System.Security.Cryptography.CryptographicException
Public Sub New (message As String, inner As Exception)

Parametreler

message
String

Özel durumun nedenini açıklayan hata iletisi.

inner
Exception

Geçerli özel durumun nedeni olan özel durum. inner parametresi değilsenull, geçerli özel durum iç özel durumu işleyen bir catch blokta oluşturulur.

Örnekler

Aşağıdaki kod örneği, özel bir hata iletisi ve iç özel durum kullanarak oluşturma CryptographicException işlemini gösterir. Bu kod örneği, sınıfı için CryptographicException sağlanan daha büyük bir örneğin parçasıdır.

String^ errorMessage = (L"The current operation is not supported.");
NullReferenceException^ nullException = gcnew NullReferenceException;
CryptographicException^ cryptographicException = gcnew CryptographicException( errorMessage,nullException );
string errorMessage = ("The current operation is not supported.");
NullReferenceException nullException = new NullReferenceException();
CryptographicException cryptographicException = 
    new CryptographicException(errorMessage, nullException);
Dim errorMessage As String = "The current operation is not supported."
Dim nullException As New NullReferenceException
Dim cryptographicException As _
    New CryptographicException(errorMessage, nullException)

Açıklamalar

Bir önceki özel durumun doğrudan bir sonucu olarak oluşturulan bir özel durum, InnerException özelliğindeki önceki özel duruma başvuru içermelidir. InnerException özelliği, oluşturucuya iletilen aynı değeri ya da InnerException özelliği oluşturucuya iç özel durum değeri sağlamıyorsa null değerini döndürür.

Aşağıdaki tablo, CryptographicException öğesinin bir örneği için başlangıç özellik değerlerini gösterir.

Özellik Değer
InnerException İç özel duruma başvuru.
Message Hata iletisi dizesi.

Ayrıca bkz.

Şunlara uygulanır

CryptographicException(String, String)

Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs
Kaynak:
CryptographicException.cs

Belirtilen biçimde belirtilen bir hata iletisiyle sınıfının yeni bir örneğini CryptographicException başlatır.

public:
 CryptographicException(System::String ^ format, System::String ^ insert);
public CryptographicException (string format, string? insert);
public CryptographicException (string format, string insert);
new System.Security.Cryptography.CryptographicException : string * string -> System.Security.Cryptography.CryptographicException
Public Sub New (format As String, insert As String)

Parametreler

format
String

Hata iletisinin çıkışını almak için kullanılan biçim.

insert
String

Özel durumun nedenini açıklayan hata iletisi.

Örnekler

Aşağıdaki kod örneği, saat biçimini ve geçerli tarihi kullanarak oluşturma CryptographicException işlemini gösterir. Bu kod örneği, sınıfı için CryptographicException sağlanan daha büyük bir örneğin parçasıdır.

String^ dateFormat = L"{0:t}";
String^ timeStamp = (DateTime::Now.ToString());
CryptographicException^ cryptographicException = gcnew CryptographicException( dateFormat,timeStamp );
string dateFormat = "{0:t}";
string timeStamp = (DateTime.Now.ToString());
CryptographicException cryptographicException = 
    new CryptographicException(dateFormat, timeStamp);
Dim dateFormat As String = "{0:t}"
Dim timeStamp As String = DateTime.Now.ToString()
Dim cryptographicException As _
    New CryptographicException(dateFormat, timeStamp)

Açıklamalar

Aşağıdaki tablo, CryptographicException öğesinin bir örneği için başlangıç özellik değerlerini gösterir.

Özellik Değer
InnerException null.
Message Hata iletisi dizesi.

Şunlara uygulanır