Click here to Skip to main content
15,919,931 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting the file version of my running assembly Pin
leppie13-Oct-04 7:24
leppie13-Oct-04 7:24 
GeneralRe: Getting the file version of my running assembly Pin
Luis Alonso Ramos13-Oct-04 7:53
Luis Alonso Ramos13-Oct-04 7:53 
GeneralRe: Getting the file version of my running assembly Pin
house13-Oct-04 8:02
house13-Oct-04 8:02 
GeneralRe: Getting the file version of my running assembly Pin
Luis Alonso Ramos13-Oct-04 8:12
Luis Alonso Ramos13-Oct-04 8:12 
GeneralLetting a user choose a file for renaming Pin
scotlandc13-Oct-04 5:21
scotlandc13-Oct-04 5:21 
GeneralRe: Letting a user choose a file for renaming Pin
yoaz13-Oct-04 6:22
yoaz13-Oct-04 6:22 
GeneralRe: Letting a user choose a file for renaming Pin
scotlandc14-Oct-04 5:43
scotlandc14-Oct-04 5:43 
GeneralNeed help to: Read binary file into a struct Pin
Gywox13-Oct-04 5:07
Gywox13-Oct-04 5:07 
I have a problem, if someone will help i'm be very happy for it.
I want to read a binary file into a struct. Please help.

public sealed class InfoHeader
{
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
private struct Info
{
public UInt32 version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=20)]
public Byte[] tapenr;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=10)]
public Byte[] client0;
};
private Info info;

public void Read(BinaryReader reader)
{
int length = (int)Marshal.SizeOf(typeof(Header));
byte [] buffer = reader.ReadBytes(length);
// What is the next step get the buffer into the struct.
}

public void Write(BinaryWriter writer) ...
}

I don´t want to do this for every property.
this.version = reader.ReadUInt32();



Gywox
GeneralRe: Need help to: Read binary file into a struct Pin
Corinna John13-Oct-04 6:14
Corinna John13-Oct-04 6:14 
GeneralGet property Pin
bbp00613-Oct-04 4:48
bbp00613-Oct-04 4:48 
GeneralRe: Get property Pin
Colin Angus Mackay13-Oct-04 5:22
Colin Angus Mackay13-Oct-04 5:22 
GeneralRe: Get property Pin
Corinna John13-Oct-04 5:56
Corinna John13-Oct-04 5:56 
GeneralJOIN Pin
pat27088113-Oct-04 4:41
pat27088113-Oct-04 4:41 
GeneralRe: JOIN Pin
Colin Angus Mackay13-Oct-04 5:27
Colin Angus Mackay13-Oct-04 5:27 
GeneralRe: JOIN Pin
pat27088113-Oct-04 5:49
pat27088113-Oct-04 5:49 
GeneralTab Pane Pin
mathon13-Oct-04 4:16
mathon13-Oct-04 4:16 
GeneralRe: Tab Pane Pin
mathon13-Oct-04 4:17
mathon13-Oct-04 4:17 
GeneralRe: Tab Pane Pin
pat27088113-Oct-04 7:19
pat27088113-Oct-04 7:19 
GeneralRe: Tab Pane Pin
J4amieC13-Oct-04 7:50
J4amieC13-Oct-04 7:50 
GeneralRe: Tab Pane Pin
pat27088113-Oct-04 8:21
pat27088113-Oct-04 8:21 
GeneralRe: Tab Pane Pin
Dave Kreskowiak13-Oct-04 9:29
mveDave Kreskowiak13-Oct-04 9:29 
GeneralSomeone please bail me out.... Pin
Vodstok13-Oct-04 3:58
Vodstok13-Oct-04 3:58 
GeneralRe: Someone please bail me out.... Pin
benjymous13-Oct-04 5:10
benjymous13-Oct-04 5:10 
GeneralRe: Someone please bail me out.... Pin
Vodstok13-Oct-04 6:30
Vodstok13-Oct-04 6:30 
GeneralRe: Someone please bail me out.... Pin
J4amieC13-Oct-04 7:47
J4amieC13-Oct-04 7: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.