Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: where do i wrong with registry key? Pin
Sasuko17-May-05 6:29
Sasuko17-May-05 6:29 
GeneralRe: where do i wrong with registry key? Pin
Sasuko17-May-05 6:36
Sasuko17-May-05 6:36 
AnswerRe: where do i wrong with registry key? Pin
OMalleyW17-May-05 6:28
OMalleyW17-May-05 6:28 
GeneralConvert byte array to bits Pin
Asad Hussain17-May-05 6:04
Asad Hussain17-May-05 6:04 
GeneralRe: Convert byte array to bits Pin
Marc Clifton17-May-05 7:42
mvaMarc Clifton17-May-05 7:42 
GeneralRe: Convert byte array to bits Pin
Asad Hussain17-May-05 8:46
Asad Hussain17-May-05 8:46 
GeneralRe: Convert byte array to bits Pin
Marc Clifton18-May-05 2:09
mvaMarc Clifton18-May-05 2:09 
GeneralRe: Convert byte array to bits Pin
Robert Rohde17-May-05 11:26
Robert Rohde17-May-05 11:26 
Have a look at the BitArray class. You can feed it with a byte array and afterwards pick the bits one after the other:
BitArray ba = new BitArray(b);
int counter = 0;
string temp = "";
while (counter < ba.Length) 
{
	int mod = counter % 8;
	temp += ba[counter - 2 * mod + 7] ? "1" : "0";
	if (counter % 5 == 4) 
	{
		Console.WriteLine(temp);
		temp = "";
	}
	counter++;
}
if (temp.Length > 0)
	Console.WriteLine("Left: " + temp);

The formula when accessing the BitArray indexer seems a bit complicated and results from the fact that the bits from each byte put into the constructor seem to be reversed.
Generalfeedback Pin
niansah17-May-05 4:54
niansah17-May-05 4:54 
GeneralRe: feedback Pin
Robert Rohde17-May-05 4:59
Robert Rohde17-May-05 4:59 
GeneralRe: feedback Pin
niansah17-May-05 5:03
niansah17-May-05 5:03 
GeneralRe: feedback Pin
Colin Angus Mackay17-May-05 5:48
Colin Angus Mackay17-May-05 5:48 
GeneralReading all particular nodes with loop Pin
ksanju100017-May-05 3:23
ksanju100017-May-05 3:23 
GeneralRe: Reading all particular nodes with loop Pin
Marc Clifton17-May-05 3:34
mvaMarc Clifton17-May-05 3:34 
GeneralRe: Reading all particular nodes with loop Pin
mav.northwind17-May-05 3:52
mav.northwind17-May-05 3:52 
GeneralRe: Reading all particular nodes with loop Pin
niansah17-May-05 4:23
niansah17-May-05 4:23 
GeneralC#, LDAP, and Active Directory Pin
slvrscremr17-May-05 3:13
slvrscremr17-May-05 3:13 
GeneralRe: C#, LDAP, and Active Directory Pin
Scott Serl17-May-05 21:23
Scott Serl17-May-05 21:23 
GeneralNeed to Read XML File Pin
Jethro6317-May-05 2:37
Jethro6317-May-05 2:37 
GeneralRe: Need to Read XML File Pin
Robert Rohde17-May-05 3:17
Robert Rohde17-May-05 3:17 
GeneralRe: Need to Read XML File Pin
Jethro6317-May-05 3:21
Jethro6317-May-05 3:21 
GeneralRe: Need to Read XML File Pin
Marc Clifton17-May-05 3:22
mvaMarc Clifton17-May-05 3:22 
GeneralRe: Need to Read XML File Pin
niansah17-May-05 3:45
niansah17-May-05 3:45 
GeneralCsharp plugin for eclipse Pin
17-May-05 1:33
suss17-May-05 1:33 
GeneralRe: Csharp plugin for eclipse Pin
Marc Clifton17-May-05 3:31
mvaMarc Clifton17-May-05 3:31 

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.