473,394 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.ASCIIEncoding
Dim Str As String = "SYSTEM"
Dim bytes As Byte() = oEncoder.GetBytes(Str)
Convert.ToBase64String(bytes, 0, bytes.Length)
MsgBox(Encoding.ASCII.GetString(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?
Nov 21 '05 #1
1 3612
Found it:

Dim Str As String = "SYSTEM"
Dim bytvalue() As Byte
bytvalue = Encoding.UTF8.GetBytes(Str.ToCharArray)
MsgBox(Convert.ToBase64String(bytvalue))

"Philip Wagenaar" wrote:
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.ASCIIEncoding
Dim Str As String = "SYSTEM"
Dim bytes As Byte() = oEncoder.GetBytes(Str)
Convert.ToBase64String(bytes, 0, bytes.Length)
MsgBox(Encoding.ASCII.GetString(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?

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: S Etchelecu | last post by:
I'm having trouble understanding the MIME::Decoder usage. Within the context of a MIME email handling program I have an array, @data, and I want to uuencode it. I thought I could instantiate a...
0
by: Matthew Lenz | last post by:
We've got a couple emails that are sent to an account on a daily basis from a third party vendor we work with. They mime encode the actual data (text/plain) and include it as an attachment (the...
3
by: Peter | last post by:
Hi, I try to make up a javascript string which contains numeric numbers in any positions. For example, I want to make a string: secretcode, where secretcode.charAt(0)==(-21),...
0
by: clevariant | last post by:
Hello, I'm tasked with creating a WSDL file that is compatible with .NET's code gen' tool, wsdl.exe. I'm getting an error in the code output saying "Missing soap:body input binding", which...
0
by: Hardy Wang | last post by:
Hi all: Anybody has some ready-to-use codes in C# to encode / decode MIME format data? Thanks! -- WWW: http://hardywang.1accesshost.com ICQ: 3359839 yours Hardy
2
by: asnowfall | last post by:
I am trying to build System.Mail.MailMessage object out of mime encoded SMTP data. I have following questions Byte byteMailData; //mime encoded STMP data for "email with attachment" 1)...
3
by: martins | last post by:
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
6
by: 7stud | last post by:
s1 = "hello" s2 = s1.encode("utf-8") s1 = "an accented 'e': \xc3\xa9" s2 = s1.encode("utf-8") The last line produces the error: --- Traceback (most recent call last):
2
by: Kris Kennaway | last post by:
I would like to MIME encode a message from a large file without first loading the file into memory. Assume the file has been pre-encoded on disk (actually I am using encode_7or8bit, so the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.