How to Clear Contents of a NotePad Textfile
-
Hi. This is sorta no brainer question for some of you, but does anyone know the C# codes to clear all contents of a certain notepad file? thanks a bunch
one way would be to use a streamWriter object and clear all the contents of the file and close the same.
Keshav Kamat :) India
-
one way would be to use a streamWriter object and clear all the contents of the file and close the same.
Keshav Kamat :) India
Try this please:-> using System.IO; FileStream fs=new System.IO.FileStream(yourTxtFilePath,FileMode.Create); fs.Close();
:^):^):^):^):^):^):^):^):^):^):^):^) :^):rose::rose::rose::rose::rose:▒▒〓▒〓▒▒ :^):rose::^):^):^):^)▒〓〓〓〓〓▒ :^):rose::^):^):^):^)▒▒〓▒〓▒▒ :^):rose::^):^):^):^)▒〓〓〓〓〓▒ :^):rose::rose::rose::rose::rose:▒▒〓▒〓▒▒ :^):^):^):^):^):^):^):^):^):^):^):^)
-
Try this please:-> using System.IO; FileStream fs=new System.IO.FileStream(yourTxtFilePath,FileMode.Create); fs.Close();
:^):^):^):^):^):^):^):^):^):^):^):^) :^):rose::rose::rose::rose::rose:▒▒〓▒〓▒▒ :^):rose::^):^):^):^)▒〓〓〓〓〓▒ :^):rose::^):^):^):^)▒▒〓▒〓▒▒ :^):rose::^):^):^):^)▒〓〓〓〓〓▒ :^):rose::rose::rose::rose::rose:▒▒〓▒〓▒▒ :^):^):^):^):^):^):^):^):^):^):^):^)