Click here to Skip to main content
15,890,186 members
Home / Discussions / C#
   

C#

 
GeneralRe: A Question Of Structure Pin
Roger Wright12-Apr-12 19:47
professionalRoger Wright12-Apr-12 19:47 
AnswerRe: A Question Of Structure Pin
Big Daddy Farang11-Apr-12 10:14
Big Daddy Farang11-Apr-12 10:14 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 21:52
professionalRoger Wright11-Apr-12 21:52 
AnswerRe: A Question Of Structure Pin
PIEBALDconsult11-Apr-12 11:30
mvePIEBALDconsult11-Apr-12 11:30 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 21:58
professionalRoger Wright11-Apr-12 21:58 
AnswerRe: A Question Of Structure Pin
Pete O'Hanlon11-Apr-12 12:33
mvePete O'Hanlon11-Apr-12 12:33 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 22:02
professionalRoger Wright11-Apr-12 22:02 
AnswerRe: A Question Of Structure Pin
RCoate11-Apr-12 18:11
RCoate11-Apr-12 18:11 
JokeRe: A Question Of Structure Pin
PIEBALDconsult11-Apr-12 18:52
mvePIEBALDconsult11-Apr-12 18:52 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 20:41
professionalRoger Wright11-Apr-12 20:41 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 22:08
professionalRoger Wright11-Apr-12 22:08 
AnswerRe: A Question Of Structure Pin
Ravi Bhavnani11-Apr-12 18:44
professionalRavi Bhavnani11-Apr-12 18:44 
AnswerRe: A Question Of Structure Pin
Eytukan11-Apr-12 20:52
Eytukan11-Apr-12 20:52 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 21:37
professionalRoger Wright11-Apr-12 21:37 
AnswerRe: A Question Of Structure Pin
Mycroft Holmes11-Apr-12 21:21
professionalMycroft Holmes11-Apr-12 21:21 
GeneralRe: A Question Of Structure Pin
Roger Wright11-Apr-12 21:51
professionalRoger Wright11-Apr-12 21:51 
GeneralRe: A Question Of Structure Pin
PIEBALDconsult12-Apr-12 3:00
mvePIEBALDconsult12-Apr-12 3:00 
GeneralRe: A Question Of Structure Pin
Roger Wright12-Apr-12 5:18
professionalRoger Wright12-Apr-12 5:18 
AnswerRe: A Question Of Structure Pin
BobJanova11-Apr-12 23:57
BobJanova11-Apr-12 23:57 
QuestionConverting special string array into two different byte arrays Pin
MichCl11-Apr-12 8:22
MichCl11-Apr-12 8:22 
Hi,
I'm trying to convert this string array to byte array. I keep getting exceptions no matter what method I try. I tried following the example on another website, but it's not working and I can't figure out how to get it into my returned byte array. So it takes strings 40, AA, and 00 and puts them in a byte array. Even if I comment out the wBuf addition, it's throwing an exception when I run it.
I'm not sure if I'm showing the string array in the code correctly. It's like this:
dataString =
"40 A8"
"AA A8"
"00 4E"

private int ExtractBytesFromDataSTringArr(string[] dataString, ref byte[] wBuf, ref byte[] sBuf)
{
int line = 0;
string [] dataString= {"40 A8", "AA A8", "00 4E"};
for (int i=0; i < myStringArr.Length; i++)
{
   delimitedChar = ' ';
   stringArray = dataString[i].Split(new char[] {delimitedChar},   StringSplitOptions.RemoveEmptyEntries);

    int NumberChars = dataString[0].Length;
    byte[] byteArr = new byte[NumberChars/2];
    for (int j = 0; j < NumberChars; j+=2)
    {
        byteArr[j/2] = Convert.ToByte(dataString[0].Substring(j,2), 16);
        wBuf[line] += byteArr; //this doesn't compile
        //sBuf[line] is stringArray[1] equivalent
     }
     line++;
}

AnswerRe: Converting special string array into two different byte arrays Pin
PIEBALDconsult11-Apr-12 9:41
mvePIEBALDconsult11-Apr-12 9:41 
GeneralRe: Converting special string array into two different byte arrays Pin
MichCl11-Apr-12 10:11
MichCl11-Apr-12 10:11 
AnswerRe: Converting special string array into two different byte arrays Pin
OriginalGriff11-Apr-12 9:50
mveOriginalGriff11-Apr-12 9:50 
GeneralRe: Converting special string array into two different byte arrays Pin
MichCl12-Apr-12 5:00
MichCl12-Apr-12 5:00 
GeneralRe: Converting special string array into two different byte arrays Pin
OriginalGriff12-Apr-12 5:56
mveOriginalGriff12-Apr-12 5:56 

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.