CONFIGURACOES REGIONAIS

JEANCOELHO 12/06/2010 05:10:44
#344663
Galera eu estava usando essa função em VB6 para pegar as configuraçoes Regionais do cliente, agora estou iniciando .net e não estou conseguindo achar nada semelhante. se alguem puder dar um help fico grato!

Const LOCALE_USER_DEFAULT = &H400
Const LOCALE_SENGCOUNTRY = &H1002 [ô] English name of country
Const LOCALE_SENGLANGUAGE = &H1001 [ô] English name of language
Const LOCALE_SNATIVELANGNAME = &H4 [ô] native name of language
Const LOCALE_SNATIVECTRYNAME = &H8 [ô] native name of country
Private Declare Function GetLocaleInfo Lib [Ô]kernel32[Ô] Alias [Ô]GetLocaleInfoA[Ô] (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Private Sub Form_Load()
[ô]KPD-Team 2001
[ô]URL: http://www.allapi.net/
[ô]E-Mail: KPDTeam@Allapi.net
MsgBox [Ô]You live in [Ô] & GetInfo(LOCALE_SENGCOUNTRY) & [Ô] ([Ô] & GetInfo(LOCALE_SNATIVECTRYNAME) & [Ô]),[Ô] & vbCrLf & [Ô]and you speak [Ô] & GetInfo(LOCALE_SENGLANGUAGE) & [Ô] ([Ô] & GetInfo(LOCALE_SNATIVELANGNAME) & [Ô]).[Ô], vbInformation
End Sub
Public Function GetInfo(ByVal lInfo As Long) As String
Dim Buffer As String, Ret As String
Buffer = String$(256, 0)
Ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer))
If Ret > 0 Then
GetInfo = Left$(Buffer, Ret - 1)
Else
GetInfo = [Ô][Ô]
End If
End Function
JEANCOELHO 12/06/2010 05:35:48
#344664
Problema Resolvido


Imports System
Imports System.Globalization
Imports System.Security.Permissions
Imports System.Threading

<Assembly: SecurityPermission(SecurityAction.RequestMinimum, ControlThread:=True)>
Public Class Regional

Public Shared Sub Language()
If (CultureInfo.CurrentCulture.ThreeLetterWindowsLanguageName) = [Ô]PTB[Ô] Then
MessageBox.Show([Ô]Brasil[Ô])
Else
MessageBox.Show(CultureInfo.CurrentCulture.ThreeLetterWindowsLanguageName)
End If
End Sub [ô]Language

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Language()
End Sub
End Class [ô]Regional
Tópico encerrado , respostas não são mais permitidas