I would like to fetch n bytes from specific place in a file into my specific data structure (a struct).
The old C - application (which we are porting) uses fseek() and fread().
Is where a comparable solution in C#/.Net, without using the Win32-API?
I would like to fetch n bytes from specific place in a file into my specific data structure (a struct).
The old C - application (which we are porting) uses fseek() and fread().
Is where a comparable solution in C#/.Net, without using the Win32-API?
I'd use the FileStream class, and then the Seek + Read methods and Position property.
I would suggest since you are porting a C application to a C# application that you store data in objects, not structs, unless you really care about overhead performance.