Click here to Skip to main content
15,881,625 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello to everyone
there is a small question: how can I open a file as a sequence of hex data? The file may be of any extension: pic, jpeg, mp4 and so on. Such a sequence is needed to perform data encryption.
Thank you in advance
Posted
Comments
Tomas Takac 20-Oct-15 4:13am    
File.Open()[^] perhaps?

1 solution

Try:
C#
byte[] data = File.ReadAllBytes(@"D:\Temp\MyFile.ext");
Provided your file is under 2GB, it'll load the whole thing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900