Hi here is a place I will post some of my small code snippets that maybe helpful to people.
commands and suggestions on the code snippets welcome.

Snippet-1 Encode string to hexadecimal, decode string from hexadecimal.

vbnet Code:
  1. Public Function EncodeDecodeStr(ByVal Source As String, ByVal Encode As Boolean) As String
  2.         Dim sb As New System.Text.StringBuilder()
  3.  
  4.         If Encode Then
  5.             'Encode to hexadecimal string.
  6.             For Each c As Char In Source
  7.                 sb.Append(Asc(c).ToString("x2"))
  8.             Next c
  9.         Else
  10.             'Decode from hexadecimal string.
  11.             For x As Integer = 0 To Source.Length - 1 Step 2
  12.                 sb.Append(Chr(Val("&H" & Source.Substring(x, 2))))
  13.             Next x
  14.         End If
  15.  
  16.         'Return new string.
  17.         Return sb.ToString()
  18.     End Function

Example.

vbnet Code:
  1. Dim s As String = "VBForums is the best forum on the net."
  2.         Dim b As String = EncodeDecodeStr(s, True) 'Encode to hex str
  3.         MessageBox.Show("Encoded: " & b, "Demo", MessageBoxButtons.OK, MessageBoxIcon.Information)
  4.         'Show decoed hex str
  5.         MessageBox.Show("Decoded: " & EncodeDecodeStr(b, False), "Demo", MessageBoxButtons.OK, MessageBoxIcon.Information)