Imports System
Public Class AsciiToHex_VB_NET
Public Shared Sub Main(ByVal args As String())
Dim asciiChar As Char = "A"c
Dim asciiValue As Integer = Convert.ToByte(asciiChar)
Dim hexValue As String = asciiValue.ToString("x")
Console.WriteLine("The hexadecimal value of '" & asciiChar & "' is: &H" & hexValue)
End Sub
End Class
' run:
'
' The hexadecimal value of 'A' is: &H41
'