Get the Nation of the User
This function gives the programmer the ability to determine the nation of the user. This could be useful for advertising purposes, or regional specific content. As far as I know, there is no function in the .NET framework that gives the programmer the ability to get the user's country, so I chose to use the registry.
VB.NET
''' <summary>
''' Get the Nation of the User.
''' </summary>
''' <returns>A String representation of the user's nation.</returns>
''' <remarks></remarks>
Public Function getNation() As String()
Return My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Control Panel\International", "sCountry", Nothing)
End Function
' Example Usage
MessageBox.Show(getNation())
See Also
- </DIC> Submission - http://www.dreamincode.net/code/snippet1518.htm
page revision: 0, last edited: 16 Dec 2007 04:59