Mime encode string

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

    #1

    Mime encode string

    I want to mime encode a string. I think that mime is base64 coding (is this
    true?).

    I created the following code:

    Dim oEncoder As New System.Text.ASC IIEncoding
    Dim Str As String = "SYSTEM"
    Dim bytes As Byte() = oEncoder.GetByt es(Str)
    Convert.ToBase6 4String(bytes, 0, bytes.Length)
    MsgBox(Encoding .ASCII.GetStrin g(bytes)

    But the MsgBox still shows up with the string SYSTEM. I know that the encode
    string should be U1lTVEVN

    What am I doing wrong?
  • Philip Wagenaar

    #2
    RE: Mime encode string

    Found it:

    Dim Str As String = "SYSTEM"
    Dim bytvalue() As Byte
    bytvalue = Encoding.UTF8.G etBytes(Str.ToC harArray)
    MsgBox(Convert. ToBase64String( bytvalue))

    "Philip Wagenaar" wrote:
    [color=blue]
    > I want to mime encode a string. I think that mime is base64 coding (is this
    > true?).
    >
    > I created the following code:
    >
    > Dim oEncoder As New System.Text.ASC IIEncoding
    > Dim Str As String = "SYSTEM"
    > Dim bytes As Byte() = oEncoder.GetByt es(Str)
    > Convert.ToBase6 4String(bytes, 0, bytes.Length)
    > MsgBox(Encoding .ASCII.GetStrin g(bytes)
    >
    > But the MsgBox still shows up with the string SYSTEM. I know that the encode
    > string should be U1lTVEVN
    >
    > What am I doing wrong?[/color]

    Comment

    Working...