CultureAndRegionInfoBuilder.Unregister(String) Método
Definição
Exclui uma cultura personalizada do computador local.Deletes a custom culture from the local computer.
public:
static void Unregister(System::String ^ cultureName);
public static void Unregister (string cultureName);
static member Unregister : string -> unit
Public Shared Sub Unregister (cultureName As String)
Parâmetros
- cultureName
- String
O nome da cultura personalizada a ser excluída.The name of the custom culture to delete.
Exceções
cultureName é uma cultura pai ou cultura de interface do usuário de fallback de console de uma cultura dependente.cultureName is a parent culture or console fallback user interface culture of a dependent culture.
O usuário não tem privilégios administrativos.The user does not have administrative privileges.
cultureName especifica uma cultura que não foi encontrada.cultureName specifies a culture that is not found.
Exemplos
O exemplo a seguir demonstra o Unregister método.The following example demonstrates the Unregister method.
// This example demonstrates the System.Globalization.Culture-
// AndRegionInfoBuilder Unregister method.
// Compile this example with a reference to sysglobl.dll.
/*
Notes:
This example deletes the custom culture x-en-US-sample.nlp
file, but not the %winnt%\Globalization directory that contains the file.
*/
using System;
using System.Globalization;
class Sample
{
public static void Main()
{
try
{
Console.Clear();
Console.WriteLine("Unregister the \"x-en-US-sample\" " +
"custom culture if it already exists...");
CultureAndRegionInfoBuilder.Unregister("x-en-US-sample");
Console.WriteLine("The custom culture was unregistered successfully.");
}
catch (Exception e)
{
Console.WriteLine("Error while unregistering...");
Console.WriteLine(e);
}
}
}
/*
This code example produces the following results:
Unregister the "x-en-US-sample" custom culture if it already exists...
The custom culture was unregistered successfully.
*/
' This example demonstrates the System.Globalization.Culture-
' AndRegionInfoBuilder Unregister method.
' Compile this example with a reference to sysglobl.dll.
'
' Notes:
' This example deletes the custom culture x-en-US-sample.nlp
' file, but not the %winnt%\Globalization directory that contains the file.
'
Imports System.Globalization
Class Sample
Public Shared Sub Main()
Try
Console.Clear()
Console.WriteLine("Unregister the ""x-en-US-sample"" " & _
"custom culture if it already exists...")
CultureAndRegionInfoBuilder.Unregister("x-en-US-sample")
Console.WriteLine("The custom culture was unregistered successfully.")
Catch e As Exception
Console.WriteLine("Error while unregistering...")
Console.WriteLine(e)
End Try
End Sub
End Class
'
'This code example produces the following results:
'
'Unregister the "x-en-US-sample" custom culture if it already exists...
'The custom culture was unregistered successfully.
'
Comentários
O Unregister método faz o inverso do Register método.The Unregister method does the reverse of the Register method. O Register método armazena uma cultura personalizada como um arquivo no computador local, no subdiretório de globalização do diretório retornado pela função GETWINDOWSDIRECTORY da API do Windows.The Register method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Windows API GetWindowsDirectory function. O Unregister método exclui o arquivo de cultura personalizada persistente do computador.The Unregister method deletes the persisted custom culture file from the computer. Depois que o arquivo é excluído, as instâncias existentes da cultura personalizada na memória do computador continuam a funcionar, mas não é possível criar novas instâncias da cultura personalizada.After the file is deleted, existing instances of the custom culture in computer memory continue to work, but new instances of the custom culture cannot be created.