Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
AnswerRe: Generic collection classes with Hashtable Pin
roel_v5-Apr-07 21:07
roel_v5-Apr-07 21:07 
QuestionHow to empty a Text file? Pin
Khoramdin5-Apr-07 12:50
Khoramdin5-Apr-07 12:50 
AnswerRe: How to empty a Text file? Pin
Luc Pattyn5-Apr-07 12:57
sitebuilderLuc Pattyn5-Apr-07 12:57 
AnswerRe: How to empty a Text file? Pin
Rudolf Jan6-Apr-07 0:32
Rudolf Jan6-Apr-07 0:32 
Questionopen OR run File Pin
TAREQ F ABUZUHRI5-Apr-07 12:28
TAREQ F ABUZUHRI5-Apr-07 12:28 
AnswerRe: open OR run File Pin
Luc Pattyn5-Apr-07 12:37
sitebuilderLuc Pattyn5-Apr-07 12:37 
QuestionHex String Pin
AAKAra5-Apr-07 11:37
AAKAra5-Apr-07 11:37 
AnswerRe: Hex String Pin
Luc Pattyn5-Apr-07 12:44
sitebuilderLuc Pattyn5-Apr-07 12:44 
Hi,

you did a binary string (only 0 and 1 can be present), not a hex string.
And it was too long.

You may try something along these lines:

int count=SecurityGroups.Items.Count;
byte[] aGroup = new byte[(count+7)/8]; // exact number of bytes needed in hex string
for (int index = 0; index < count; index++) {
    if (SecurityGroups.Items[index].Selected)
        aGroup[index/8] |= 1<<(index%8); // OR one of the numbers 1,2,4,8,16,32,64,128
}


if all items were selected, this would or 1 to aGroup[0], then 2 to aGroup[0], then 4,
etc.; then 1 to aGroup[1] and so on, as you probably want.

Smile | :)


Luc Pattyn

[My Articles]

GeneralRe: Hex String Pin
AAKAra6-Apr-07 3:52
AAKAra6-Apr-07 3:52 
GeneralRe: Hex String Pin
Luc Pattyn6-Apr-07 4:11
sitebuilderLuc Pattyn6-Apr-07 4:11 
GeneralRe: Hex String Pin
AAKAra6-Apr-07 11:39
AAKAra6-Apr-07 11:39 
QuestionPDF Generation Tool Pin
RB@Emphasys5-Apr-07 10:33
RB@Emphasys5-Apr-07 10:33 
Questionhandle to process Pin
likefood5-Apr-07 8:16
likefood5-Apr-07 8:16 
AnswerRe: handle to process Pin
pbraun5-Apr-07 8:55
pbraun5-Apr-07 8:55 
GeneralRe: handle to process Pin
likefood5-Apr-07 13:22
likefood5-Apr-07 13:22 
Questionhow to code a administrator login page using C#.net and ASP.net 1.1 Pin
sudhanshuk3ito515-Apr-07 6:07
sudhanshuk3ito515-Apr-07 6:07 
AnswerRe: how to code a administrator login page using C#.net and ASP.net 1.1 Pin
Sathesh Sakthivel5-Apr-07 6:42
Sathesh Sakthivel5-Apr-07 6:42 
AnswerRe: how to code a administrator login page using C#.net and ASP.net 1.1 Pin
Not Active5-Apr-07 7:08
mentorNot Active5-Apr-07 7:08 
QuestionListBox Pin
AAKAra5-Apr-07 5:51
AAKAra5-Apr-07 5:51 
AnswerRe: ListBox Pin
kubben5-Apr-07 5:58
kubben5-Apr-07 5:58 
GeneralRe: ListBox Pin
AAKAra5-Apr-07 11:36
AAKAra5-Apr-07 11:36 
QuestionI don´t know how to access my components to the groupbox Pin
Ens805-Apr-07 5:50
Ens805-Apr-07 5:50 
AnswerRe: I don´t know how to access my components to the groupbox Pin
BoneSoft5-Apr-07 6:33
BoneSoft5-Apr-07 6:33 
GeneralRe: I don´t know how to access my components to the groupbox Pin
Ens805-Apr-07 7:56
Ens805-Apr-07 7:56 
GeneralRe: I don´t know how to access my components to the groupbox Pin
BoneSoft5-Apr-07 8:47
BoneSoft5-Apr-07 8:47 

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.