Hello,
I am making a small encryption application and for that I want to change
bytes in my file.
how can I do this using c#?
thanks!
:wave:
Printable View
Hello,
I am making a small encryption application and for that I want to change
bytes in my file.
how can I do this using c#?
thanks!
:wave:
Create a FileStream object, either directly or through the File class, and then use it to read and/or write bytes to the disc file.
jmcilhinney has a great knowledge but doesn't like to give code samples unless it's very necessary, but I do
so here is how you can do it, just like he said:
Code:FileStream fs=new FileStream(@"C:\myText.txt",FileMode.Open,FileAccess.ReadWrite);
while(fs.Position<fs.Length){
byte bf=fs.ReadByte();
//Do any encryption on the byte
fs.WriteByte(bf);
}
thanks to the both of you!! :bigyello: :D :bigyello: