Operating file system (2) Construction, write, reading

xiaoxiao2021-03-06  104

Private void button3_click (object sender, system.eventargs e) {// write binary binaryWriter BW; // Create a binary filestream fs = new filestream (mappath ("mydata.data"), filemode.create; bw = new BinaryWriter (fs); // Initialize a binarywriter for (INT i = 0; i <200; i ) bw.write (i); // Write BW.CLOSE (); // Close}

Private void button4_click (object sender, system.eventargs e) {// Read binary binaryreader br; string str = ""; filestream fs = new filestream (Mappath ("MyData.Data"), filemode.open; br = new BinaryReader (FS); for (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-103130.html

New Post(0)