MIME BASE64

  • Thread starter Thread starter martins
  • Start date Start date
M

martins

hi,

I'm looking for some code to encode and decode strings in MIME BASE 64 on
vb.net or basic

Is there something that I can use ?

thank you
 
martins said:
I'm looking for some code to encode and decode strings in MIME BASE 64 on
vb.net or basic

Is there something that I can use ?

Well, there's Convert.ToBase64String and Convert.FromBase64String. If
there are extra MIME parts you need to understand, that's a separate
matter.
 
Jon Skeet said:
Well, there's Convert.ToBase64String and Convert.FromBase64String. If
there are extra MIME parts you need to understand, that's a separate
matter.

thanks

if I have a mime base64 string like this :

dim mimeStr as string = "AAAAAPQBAAAI4ggAXHZpZGVvLnBhc3MALgBwAGEAcwBz"

How can I convert then to a plain string ?

don't know nothing about this

I tried :

Dim PText() As Byte = Convert.FromBase64String(mimeStr)
Dim i As Integer
Dim s As String = ""
For i = 0 To UBound(PText)
s = s + Chr(PText(i))
Next
MsgBox(s)
 
martins said:
if I have a mime base64 string like this :

dim mimeStr as string = "AAAAAPQBAAAI4ggAXHZpZGVvLnBhc3MALgBwAGEAcwBz"

How can I convert then to a plain string ?

Well, Base64 encodes binary data, not text as such. You can use
Convert.FromBase64String to get a byte array, but if that's meant to
represent an encoded text string, you'll need to use something like
Encoding.GetString - but you'll need to know what encoding was used to
encode the string in the first place.
 
Back
Top