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

C#

 
QuestionBHO and cookies ? Pin
tsahiB27-Feb-09 21:24
tsahiB27-Feb-09 21:24 
QuestionLooking for tips & tricks Pin
E_Gold27-Feb-09 20:08
E_Gold27-Feb-09 20:08 
AnswerRe: Looking for tips & tricks Pin
Abhijit Jana27-Feb-09 20:42
professionalAbhijit Jana27-Feb-09 20:42 
GeneralRe: Looking for tips & tricks Pin
E_Gold27-Feb-09 21:14
E_Gold27-Feb-09 21:14 
AnswerRe: Looking for tips & tricks Pin
Eddy Vluggen27-Feb-09 22:31
professionalEddy Vluggen27-Feb-09 22:31 
QuestionProblem with Generic Collection and Interface Pin
_ro_bb_o27-Feb-09 19:06
_ro_bb_o27-Feb-09 19:06 
AnswerRe: Problem with Generic Collection and Interface Pin
DaveyM6928-Feb-09 2:40
professionalDaveyM6928-Feb-09 2:40 
QuestionReading a Packet assistance Pin
Andrew Timmins27-Feb-09 18:46
Andrew Timmins27-Feb-09 18:46 
Hello,
Can someone help me understand how to read a packet?
I believe i have gathered all the necessary bytes but am having a hard time reading the data from the packet.

I thought I could attach the pdf here, but instead i will provide a snippet and maybe i can move on from there.
Here are the first 10 bytes as described in the document I have.

Unique Header Bytes
Byte1: Header Byte 0xFE
Byte2: Header Byte 0xFF
Byte3: Header Byte 0x03

The value of “Volt” must be divided by ten. This provides one
decimal place resolution.

Byte4: Volt Hi Byte
Byte5: Volt Low Byte

CH1 Absolute Watt-Second counter.
This 5-byte counter increments with energy flowing in either direction (consuming or producing).

Byte6: CH1 W-S Byte1 (LSB)
Byte7: CH1 W-S Byte2
Byte8: CH1 W-S Byte3
Byte9: CH1 W-S Byte4
Byte10: CH1 W-S Byte5 (MSB)


I tried the following code to get the VOLTS, but its not working.
private void ProcessData(SocketPacket packet)
{

byte[] buffer = new byte[packet.ms.Length];
//packet.ms.Position = 0;
packet.ms.Seek(3, SeekOrigin.Begin);

packet.ms.Read(buffer,0,2);
int data = BitConverter.ToInt32(buffer, 0);

}

Can anyone offer some ideas?

Drew
AnswerRe: Reading a Packet assistance Pin
Jimmanuel28-Feb-09 1:43
Jimmanuel28-Feb-09 1:43 
QuestionTo Create Crystal Reports With Dynamic Values Pin
aashish.saalvi27-Feb-09 18:46
aashish.saalvi27-Feb-09 18:46 
QuestionC# drag and drop from Treeview to Listview Pin
AlCsharp27-Feb-09 18:01
AlCsharp27-Feb-09 18:01 
AnswerRe: C# drag and drop from Treeview to Listview Pin
Calin Tatar28-Feb-09 1:02
Calin Tatar28-Feb-09 1:02 
QuestionAny good .net obfuscator ? Pin
Kim061827-Feb-09 15:11
Kim061827-Feb-09 15:11 
AnswerRe: Any good .net obfuscator ? Pin
Eddy Vluggen27-Feb-09 23:05
professionalEddy Vluggen27-Feb-09 23:05 
Questionthe problem of set the default page for html help maker (.chm) Pin
Seraph_summer27-Feb-09 10:43
Seraph_summer27-Feb-09 10:43 
QuestionDirectory of the App file ? Pin
Mohammad Dayyan27-Feb-09 10:01
Mohammad Dayyan27-Feb-09 10:01 
AnswerRe: Directory of the App file ? Pin
Calin Tatar27-Feb-09 10:02
Calin Tatar27-Feb-09 10:02 
GeneralRe: Directory of the App file ? Pin
Mohammad Dayyan27-Feb-09 10:05
Mohammad Dayyan27-Feb-09 10:05 
QuestionUsb control channel and buzzer Pin
thomaxz.tc27-Feb-09 8:52
thomaxz.tc27-Feb-09 8:52 
AnswerRe: Usb control channel and buzzer Pin
Curtis Schlak.27-Feb-09 11:43
Curtis Schlak.27-Feb-09 11:43 
GeneralRe: Usb control channel and buzzer Pin
thomaxz.tc28-Feb-09 4:09
thomaxz.tc28-Feb-09 4:09 
QuestionProblem In Middle Tire Pin
naim khan27-Feb-09 8:19
naim khan27-Feb-09 8:19 
AnswerRe: Problem In Middle Tire Pin
Colin Angus Mackay27-Feb-09 10:19
Colin Angus Mackay27-Feb-09 10:19 
GeneralRe: Problem In Middle Tire Pin
Sava Savanovic27-Feb-09 22:47
Sava Savanovic27-Feb-09 22:47 
AnswerRe: Problem In Middle Tire Pin
Christian Graus27-Feb-09 10:40
protectorChristian Graus27-Feb-09 10:40 

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.