RanchuPanchu
Programmer
Hello,
I am new to XML.
I am working on a project of a packet sniffer, and I have a set of messeges with specific structures (which is actually the data in these IP packets).
I thought that defining these messeges struct in XML, will make my code more generic.
Can you refer me maybe to an example as to how in XML , I can define a structure (if I don't use XML, and only hardcoded the structure, it would look like this:
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct EventLogRecord
{
public uint Length;
public uint Opcode;
public uint RecordNumber;
public uint TimeGenerated;
public uint TimeWritten;
public uint EventID;
}
and how I can then create such structure from what I defines in the XML, (in order to read data into struct).
Thank you for the help,
Ran
I am new to XML.
I am working on a project of a packet sniffer, and I have a set of messeges with specific structures (which is actually the data in these IP packets).
I thought that defining these messeges struct in XML, will make my code more generic.
Can you refer me maybe to an example as to how in XML , I can define a structure (if I don't use XML, and only hardcoded the structure, it would look like this:
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct EventLogRecord
{
public uint Length;
public uint Opcode;
public uint RecordNumber;
public uint TimeGenerated;
public uint TimeWritten;
public uint EventID;
}
and how I can then create such structure from what I defines in the XML, (in order to read data into struct).
Thank you for the help,
Ran