CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    3

    Exclamation Wanted: MIME Decoder

    I'm looking for C# code that has a MIME decoder.

    Anyone?


    rflagg

  2. #2
    Join Date
    Jun 2002
    Location
    USA
    Posts
    3
    Try this code in C# to convert base64-encoded text (FromBase64Transform class can be found in System.Security.Cryptography namespace)

    FromBase64Transform transformer = new FromBase64Transform();
    byte[] byteData = transformer.TransformFinalBlock(base64Data, 0, base64Data.Length);

    It's counterpart is ToBase64Transform.

    Have fun.

  3. #3
    Join Date
    Jun 2002
    Posts
    3
    Originally posted by AlenT
    Try this code in C# to convert base64-encoded text (FromBase64Transform class can be found in System.Security.Cryptography namespace)

    FromBase64Transform transformer = new FromBase64Transform();
    byte[] byteData = transformer.TransformFinalBlock(base64Data, 0, base64Data.Length);

    It's counterpart is ToBase64Transform.

    Have fun.
    Thanks. But that is just one piece of the MIME puzzle. I need something that can deMIME this shortened example:
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
    boundary="----=_NextPart_000_0000_01C20BF2.B40CBCC0"
    Thread-Index: AcIMLVzIoG7skYNvTZqVxcybu46cew==
    Content-Class: urn:content-classes:message
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    This is a multi-part message in MIME format.

    ------=_NextPart_000_0000_01C20BF2.B40CBCC0
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    This
    is some text being sent along!
    ------=_NextPart_000_0000_01C20BF2.B40CBCC0
    Content-Type: application/octet-stream;
    name="rad2E822.tmp"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="rad2E822.tmp"

    gAAAANAMFgEAAAEMIwBClgAARQRcAAAAlloGAAABAAAAAAAABAAAAAAwMTkyMjQ4MCAgICAgICAg
    IDA3NTI0MDAxIEEwMDEwMTAxQ0cgICAgNDcgICAgVUhSQlROOCAgICAgICAwMDI4ICAgICAgICAg
    (This is the Base64 portion that your code snippit can decode!)
    ///////////////////////ABABA

    ------=_NextPart_000_0000_01C20BF2.B40CBCC0--

  4. #4
    Join Date
    Jun 2002
    Location
    USA
    Posts
    3
    O-ops, sorry. Thought you only needed to decode the base64 attachement - that's the most difficult part usually - and the solution seemed simple enough using FromBase64Transform .

    Alen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured