Click here to Skip to main content
15,905,913 members
Home / Discussions / C#
   

C#

 
GeneralRe: database connection problem Pin
MNantu7-Dec-09 0:40
MNantu7-Dec-09 0:40 
GeneralRe: database connection problem Pin
Erdinc277-Dec-09 1:19
Erdinc277-Dec-09 1:19 
QuestionConverting BitArray to string Pin
Joe Rozario6-Dec-09 21:37
Joe Rozario6-Dec-09 21:37 
AnswerRe: Converting BitArray to string Pin
dan!sh 6-Dec-09 21:45
professional dan!sh 6-Dec-09 21:45 
GeneralRe: Converting BitArray to string Pin
Joe Rozario6-Dec-09 21:55
Joe Rozario6-Dec-09 21:55 
AnswerRe: Converting BitArray to string Pin
shiplu_20506-Dec-09 22:27
shiplu_20506-Dec-09 22:27 
GeneralRe: Converting BitArray to string Pin
Joe Rozario6-Dec-09 22:32
Joe Rozario6-Dec-09 22:32 
AnswerRe: Converting BitArray to string Pin
OriginalGriff6-Dec-09 23:17
mveOriginalGriff6-Dec-09 23:17 
If I read your messages correctly, you want to take in a string of 16 '0' or '1' characters, and convert them to two bytes, then convert the two bytes back to s string?
If so, then the first thing you need to look at is the "<<" operator. This shifts bits a number of places to the left within a byte, int or whatever.
So you would:

For each character in string, convert it to a byte (0 or 1) depending on whether it was '0' or '1'.
Shift that bit into a byte until the byte is full. Save the byte, and move on for the next.

Re-assembling the string from your bytes is the reverse of this, and is probably best done with a method to convert a byte to an 8 character string, used twice.

Honestly, it is quicker to write the code, than to describe it!

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

"Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

AnswerRe: Converting BitArray to string Pin
Luc Pattyn7-Dec-09 0:36
sitebuilderLuc Pattyn7-Dec-09 0:36 
GeneralRe: Converting BitArray to string Pin
Joe Rozario7-Dec-09 7:27
Joe Rozario7-Dec-09 7:27 
QuestionCPU Load of a MDI-Child Pin
DrNokill6-Dec-09 19:39
DrNokill6-Dec-09 19:39 
QuestionCustomize Quick Access Toolbar for MS Office 2007 applications Pin
Dumb Programmer6-Dec-09 18:34
Dumb Programmer6-Dec-09 18:34 
Questioncrawling a data of a website Pin
uglyeyes6-Dec-09 14:35
uglyeyes6-Dec-09 14:35 
AnswerRe: crawling a data of a website Pin
Mycroft Holmes6-Dec-09 18:48
professionalMycroft Holmes6-Dec-09 18:48 
QuestionBuiltin function for getting all ip addresses? Pin
Jacob Dixon6-Dec-09 14:23
Jacob Dixon6-Dec-09 14:23 
AnswerRe: Builtin function for getting all ip addresses? Pin
Dave Kreskowiak6-Dec-09 15:46
mveDave Kreskowiak6-Dec-09 15:46 
AnswerRe: Builtin function for getting all ip addresses? Pin
Jacob Dixon6-Dec-09 16:59
Jacob Dixon6-Dec-09 16:59 
GeneralRe: Builtin function for getting all ip addresses? Pin
Mycroft Holmes6-Dec-09 18:50
professionalMycroft Holmes6-Dec-09 18:50 
Questionget file name (only) Pin
tamir9016-Dec-09 10:22
tamir9016-Dec-09 10:22 
AnswerRe: get file name (only) Pin
Blue_Boy6-Dec-09 10:29
Blue_Boy6-Dec-09 10:29 
AnswerRe: get file name (only) Pin
PIEBALDconsult6-Dec-09 17:36
mvePIEBALDconsult6-Dec-09 17:36 
GeneralRe: get file name (only) Pin
tamir9016-Dec-09 20:49
tamir9016-Dec-09 20:49 
Question"View Code" Dropdown Pin
bailout006-Dec-09 8:11
bailout006-Dec-09 8:11 
AnswerRe: "View Code" Dropdown Pin
Saksida Bojan6-Dec-09 8:14
Saksida Bojan6-Dec-09 8:14 
GeneralRe: "View Code" Dropdown Pin
bailout006-Dec-09 9:03
bailout006-Dec-09 9: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.