How to convert string to base64 in .net framework 4

So, I went around the internet looking for a way to convert plain text (string) to base64 string and found many solutions. I am trying to use:

Dim byt As Byte() = System.Text.Encoding.UTF8.GetBytes(TextBox1.Text)
TextBox2.Text = convert.ToBase64String(byt)

but in the end an error message appears

'ToBase64String' is not a member of 'System.Windows.Forms.Timer'.

What should I do to fix this? Or, if there is a better way to encode it, please help.

+5
source share
1 answer

Use System.Convert.ToBase64String(byt). Otherwise, the timer will be selected as the innermost matching name.
Not the best name for a btw timer.

+16
source

All Articles