Click here to Skip to main content
16,005,178 members
Home / Discussions / C#
   

C#

 
QuestionSending SMS from PC to all MobilePhones Pin
middesrinivasarao@yahoo.co.in13-Dec-05 21:33
middesrinivasarao@yahoo.co.in13-Dec-05 21:33 
QuestionMTAThread and AllowDrop? Pin
M-200013-Dec-05 21:19
M-200013-Dec-05 21:19 
QuestionConvert a String to Binary Pin
climbjm13-Dec-05 20:40
climbjm13-Dec-05 20:40 
AnswerRe: Convert a String to Binary Pin
-Rowan-13-Dec-05 21:25
-Rowan-13-Dec-05 21:25 
GeneralRe: Convert a String to Binary Pin
climbjm14-Dec-05 0:08
climbjm14-Dec-05 0:08 
GeneralRe: Convert a String to Binary Pin
-Rowan-14-Dec-05 0:41
-Rowan-14-Dec-05 0:41 
AnswerRe: Convert a String to Binary Pin
Vikram A Punathambekar13-Dec-05 21:28
Vikram A Punathambekar13-Dec-05 21:28 
AnswerRe: Convert a String to Binary Pin
MarcelErz13-Dec-05 21:44
MarcelErz13-Dec-05 21:44 
Hi!

Do you want to save the data in a byte array? You have to take care what character you are using, if it is not european and american characters, you should keep it as unicode. Otherwise, don't waste the space and convert it to binary ascii. Hre are tow examples:

<br />
// Convert from Unicode string to ASCII-Byte-Array<br />
Byte[] lbASCII = System.Text.Encoding.ASCII.GetBytes(textBox1.Text);<br />
<br />
// Convert from Unicode string to Unicode-Byte-Array <br />
// (each unicode character is 16-bit, so use 2 bytes)<br />
Byte[] lbUnicode = System.Text.Encoding.Unicode.GetBytes(textBox1.Text);<br />


I hope this is what you want!

To convert it back to an unicode string, you can use this:

<br />
// Convert from ASCII-Byte-Array to Unicode string<br />
string lsString1 = System.Text.Encoding.ASCII.GetString(lbASCII);<br />
<br />
// Convert from Unicode-Byte-Array to Unicode string<br />
// (each unicode character is 16-bit, so use 2 bytes)<br />
string lsString2 = System.Text.Encoding.Unicode.GetString(lbUnicode);<br />


Marcel Erz

-- modified at 3:44 Wednesday 14th December, 2005
Questionopen a remote excel file Pin
cerdemorenel13-Dec-05 20:07
cerdemorenel13-Dec-05 20:07 
QuestionDefining Global Variable Pin
freshonlineMax13-Dec-05 20:03
freshonlineMax13-Dec-05 20:03 
AnswerRe: Defining Global Variable Pin
-Rowan-13-Dec-05 21:07
-Rowan-13-Dec-05 21:07 
GeneralRe: Defining Global Variable Pin
MarcelErz13-Dec-05 21:27
MarcelErz13-Dec-05 21:27 
GeneralRe: Defining Global Variable Pin
freshonlineMax13-Dec-05 22:45
freshonlineMax13-Dec-05 22:45 
GeneralRe: Defining Global Variable Pin
MarcelErz13-Dec-05 23:06
MarcelErz13-Dec-05 23:06 
GeneralRe: Defining Global Variable Pin
freshonlineMax14-Dec-05 18:04
freshonlineMax14-Dec-05 18:04 
GeneralRe: Defining Global Variable Pin
ariez78631-Dec-08 21:00
ariez78631-Dec-08 21:00 
AnswerRe: Defining Global Variable Pin
Vikram A Punathambekar13-Dec-05 21:32
Vikram A Punathambekar13-Dec-05 21:32 
QuestionCustom window in C# Pin
CoolASL13-Dec-05 18:35
CoolASL13-Dec-05 18:35 
AnswerRe: Custom window in C# Pin
MarcelErz13-Dec-05 21:34
MarcelErz13-Dec-05 21:34 
GeneralRe: Custom window in C# Pin
CoolASL13-Dec-05 22:15
CoolASL13-Dec-05 22:15 
GeneralRe: Custom window in C# Pin
MarcelErz13-Dec-05 22:32
MarcelErz13-Dec-05 22:32 
GeneralRe: Custom window in C# Pin
CoolASL13-Dec-05 22:35
CoolASL13-Dec-05 22:35 
GeneralRe: Custom window in C# Pin
CoolASL14-Dec-05 2:30
CoolASL14-Dec-05 2:30 
QuestionTextfile and its schema Pin
Mahi.Ragava13-Dec-05 18:19
Mahi.Ragava13-Dec-05 18:19 
AnswerRe: Textfile and its schema Pin
MarcelErz13-Dec-05 22:03
MarcelErz13-Dec-05 22:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.