I found some information on the Internet and put it here. What are some tips for the experts to take when they pass by? Please give me some advice!
========================================================== ======================================
Filestream FS = new filestream (@ ".../demo.txt", filemode. Open );
String temp = "study every day ";
Byte [] buffer = encoding. Default. getbytes (temp );
String d = encoding. Default. getstring (buffer );
FS. Seek (13, seekorigin. Current );
FS. Write (buffer, 0, buffer. Length );
FS. Close ();
This write can be inserted, and there is no garbled problem. the insert method is "Overwrite Insert", which is equivalent to pressing the "insert" key and then inputting data. if you set filemode. change Open to filemode. append will be garbled
========================================================== ======================================