MIME BASE64

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • martins

    MIME BASE64

    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





  • Jon Skeet [C# MVP]

    #2
    Re: MIME BASE64

    martins <xxx@hotmail.co m> wrote:[color=blue]
    > 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 ?[/color]

    Well, there's Convert.ToBase6 4String and Convert.FromBas e64String. If
    there are extra MIME parts you need to understand, that's a separate
    matter.

    --
    Jon Skeet - <skeet@pobox.co m>
    http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
    If replying to the group, please do not mail me too

    Comment

    • martins

      #3
      Re: MIME BASE64

      "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
      news:MPG.1e6a52 ff5dbe0a3598ce9 d@msnews.micros oft.com...[color=blue]
      > martins <xxx@hotmail.co m> wrote:[color=green]
      >> 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 ?[/color]
      >
      > Well, there's Convert.ToBase6 4String and Convert.FromBas e64String. If
      > there are extra MIME parts you need to understand, that's a separate
      > matter.
      >[/color]

      thanks

      if I have a mime base64 string like this :

      dim mimeStr as string = "AAAAAPQBAAAI4g gAXHZpZGVvLnBhc 3MALgBwAGEAcwBz "

      How can I convert then to a plain string ?

      don't know nothing about this

      I tried :

      Dim PText() As Byte = Convert.FromBas e64String(mimeS tr)
      Dim i As Integer
      Dim s As String = ""
      For i = 0 To UBound(PText)
      s = s + Chr(PText(i))
      Next
      MsgBox(s)


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: MIME BASE64

        martins <xxx@hotmail.co m> wrote:[color=blue]
        > if I have a mime base64 string like this :
        >
        > dim mimeStr as string = "AAAAAPQBAAAI4g gAXHZpZGVvLnBhc 3MALgBwAGEAcwBz "
        >
        > How can I convert then to a plain string ?[/color]

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

        --
        Jon Skeet - <skeet@pobox.co m>
        http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
        If replying to the group, please do not mail me too

        Comment

        Working...