Sdílet prostřednictvím


RightsManagementException Konstruktory

Definice

Inicializuje novou instanci RightsManagementException třídy .

Přetížení

RightsManagementException()

Inicializuje novou instanci RightsManagementException třídy .

RightsManagementException(RightsManagementFailureCode)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode.

RightsManagementException(String)

Inicializuje novou instanci RightsManagementException třídy s danou zprávou.

RightsManagementException(SerializationInfo, StreamingContext)

Inicializuje novou instanci RightsManagementException třídy a nastaví SerializationInfo úložiště s informacemi o výjimce.

RightsManagementException(RightsManagementFailureCode, Exception)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode a InnerException.

RightsManagementException(RightsManagementFailureCode, String)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode a Message.

RightsManagementException(String, Exception)

Inicializuje novou instanci RightsManagementException třídy s danou Message a InnerException.

RightsManagementException(RightsManagementFailureCode, String, Exception)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode, Message a InnerException.

Příklady

Následující příklad ukazuje použití RightsManagementException.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

RightsManagementException()

Inicializuje novou instanci RightsManagementException třídy .

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

Příklady

Následující příklad ukazuje použití RightsManagementException.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro

RightsManagementException(RightsManagementFailureCode)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode.

public:
 RightsManagementException(System::Security::RightsManagement::RightsManagementFailureCode failureCode);
public RightsManagementException (System.Security.RightsManagement.RightsManagementFailureCode failureCode);
new System.Security.RightsManagement.RightsManagementException : System.Security.RightsManagement.RightsManagementFailureCode -> System.Security.RightsManagement.RightsManagementException
Public Sub New (failureCode As RightsManagementFailureCode)

Parametry

failureCode
RightsManagementFailureCode

Kód chyby.

Příklady

Následující příklad ukazuje použití FailureCode vlastnosti k vytvoření chybové zprávy pro uživatele.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro

RightsManagementException(String)

Inicializuje novou instanci RightsManagementException třídy s danou zprávou.

public:
 RightsManagementException(System::String ^ message);
public RightsManagementException (string message);
new System.Security.RightsManagement.RightsManagementException : string -> System.Security.RightsManagement.RightsManagementException
Public Sub New (message As String)

Parametry

message
String

Zpráva popisující chybu

Příklady

Následující příklad ukazuje použití Message vlastnosti k vytvoření chybové zprávy pro uživatele.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro

RightsManagementException(SerializationInfo, StreamingContext)

Inicializuje novou instanci RightsManagementException třídy a nastaví SerializationInfo úložiště s informacemi o výjimce.

protected:
 RightsManagementException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected RightsManagementException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Security.RightsManagement.RightsManagementException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.RightsManagement.RightsManagementException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parametry

info
SerializationInfo

Objekt, který obsahuje serializovaná data.

context
StreamingContext

Kontextové informace o zdroji nebo cíli

Viz také

Platí pro

RightsManagementException(RightsManagementFailureCode, Exception)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode a InnerException.

public:
 RightsManagementException(System::Security::RightsManagement::RightsManagementFailureCode failureCode, Exception ^ innerException);
public RightsManagementException (System.Security.RightsManagement.RightsManagementFailureCode failureCode, Exception innerException);
new System.Security.RightsManagement.RightsManagementException : System.Security.RightsManagement.RightsManagementFailureCode * Exception -> System.Security.RightsManagement.RightsManagementException
Public Sub New (failureCode As RightsManagementFailureCode, innerException As Exception)

Parametry

failureCode
RightsManagementFailureCode

Kód chyby.

innerException
Exception

Instance výjimky, která způsobila chybu.

Příklady

Následující příklad ukazuje použití FailureCode vlastností a Message k vytvoření chybové zprávy pro uživatele.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro

RightsManagementException(RightsManagementFailureCode, String)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode a Message.

public:
 RightsManagementException(System::Security::RightsManagement::RightsManagementFailureCode failureCode, System::String ^ message);
public RightsManagementException (System.Security.RightsManagement.RightsManagementFailureCode failureCode, string message);
new System.Security.RightsManagement.RightsManagementException : System.Security.RightsManagement.RightsManagementFailureCode * string -> System.Security.RightsManagement.RightsManagementException
Public Sub New (failureCode As RightsManagementFailureCode, message As String)

Parametry

failureCode
RightsManagementFailureCode

Kód chyby.

message
String

Zpráva popisující chybu

Příklady

Následující příklad ukazuje použití FailureCode vlastností a Message k vytvoření chybové zprávy pro uživatele.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro

RightsManagementException(String, Exception)

Inicializuje novou instanci RightsManagementException třídy s danou Message a InnerException.

public:
 RightsManagementException(System::String ^ message, Exception ^ innerException);
public RightsManagementException (string message, Exception innerException);
new System.Security.RightsManagement.RightsManagementException : string * Exception -> System.Security.RightsManagement.RightsManagementException
Public Sub New (message As String, innerException As Exception)

Parametry

message
String

Zpráva popisující chybu

innerException
Exception

Instance výjimky, která způsobila tuto výjimku.

Příklady

Následující příklad ukazuje použití Message vlastnosti k vytvoření chybové zprávy pro uživatele.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro

RightsManagementException(RightsManagementFailureCode, String, Exception)

Inicializuje novou instanci RightsManagementException třídy s danou RightsManagementFailureCode, Message a InnerException.

public:
 RightsManagementException(System::Security::RightsManagement::RightsManagementFailureCode failureCode, System::String ^ message, Exception ^ innerException);
public RightsManagementException (System.Security.RightsManagement.RightsManagementFailureCode failureCode, string message, Exception innerException);
new System.Security.RightsManagement.RightsManagementException : System.Security.RightsManagement.RightsManagementFailureCode * string * Exception -> System.Security.RightsManagement.RightsManagementException
Public Sub New (failureCode As RightsManagementFailureCode, message As String, innerException As Exception)

Parametry

failureCode
RightsManagementFailureCode

Kód chyby.

message
String

Zpráva popisující chybu

innerException
Exception

Instance výjimky, která způsobila chybu.

Příklady

Následující příklad ukazuje použití FailureCode vlastností a Message k vytvoření chybové zprávy pro uživatele.

WriteStatus("   Building secure environment.");
try
{
    string applicationManifest = "<manifest></manifest>";
    if (File.Exists("rpc.xml"))
    {
        StreamReader manifestReader = File.OpenText("rpc.xml");
        applicationManifest = manifestReader.ReadToEnd();
    }

    if (_secureEnv == null)
    {
        if (SecureEnvironment.IsUserActivated(new ContentUser(
                    _currentUserId, AuthenticationType.Windows)))
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest, new ContentUser(
                    _currentUserId, AuthenticationType.Windows));
        }
        else
        {
            _secureEnv = SecureEnvironment.Create(
                applicationManifest,
                AuthenticationType.Windows,
                UserActivationMode.Permanent);
        }
    }
}
catch (RightsManagementException ex)
{
    MessageBox.Show("ERROR: Failed to build secure environment.\n" +
        "Exception: " + ex.Message + "\n\n" +
        ex.FailureCode.ToString() + "\n\n" + ex.StackTrace,
        "Rights Management Exception",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}
WriteStatus("   Building secure environment.")
Try
    Dim applicationManifest As String = "<manifest></manifest>"
    If File.Exists("rpc.xml") Then
        Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
        applicationManifest = manifestReader.ReadToEnd()
    End If

    If _secureEnv Is Nothing Then
        If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
            _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
        Else
            _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
        End If
    End If
Catch ex As RightsManagementException
    MessageBox.Show("ERROR: Failed to build secure environment." & vbLf & "Exception: " & ex.Message & vbLf & vbLf & ex.FailureCode.ToString() & vbLf & vbLf & ex.StackTrace, "Rights Management Exception", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

Platí pro