开发者

Handling File Contents Before Writing to Disc C#

开发者 https://www.devze.com 2023-01-07 08:47 出处:网络
So I have decrypted a file and am left with a byte array containing this (Uni-encoded): Content-Type: text/plain;

So I have decrypted a file and am left with a byte array containing this (Uni-encoded):

Content-Type: text/plain;
    name="testfile.txt"
Content-Transfer-Encoding: binary
Content-Disposition: attachment;
    filename="testfile.txt"

My super secret message.

Where "My super secret message." is the contents of the file, which could be any time of file contents (Word, Excel, etc.). What would be the best way of parsing this information and writing the original file back to the drive?

Is it possible that this binary data is actually an email attatchment? How would I go about re-开发者_JS百科creating the email attachment then pull out the original file?


Perhaps this MIME parser will help:

http://www.codeproject.com/KB/cs/mime_project.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号