Can any one tell why the previous data is still displayed while saving data using StreamWriter

前端 未结 2 428
情深已故
情深已故 2021-01-28 05:43

I am saving data to a file-name using Stream writer but if i run the code for second time the same data is appended to the previous data but i would like to clear the old data a

2条回答
  •  滥情空心
    2021-01-28 06:18

    Second parameter here: new StreamWriter(StrFilePath,true) is set to true, which means append to file. Set that parameter to false and it will work.

提交回复
热议问题