Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

'WriteAllText' doesn't overwrite the exsisting

$
0
0
Hey people,

So what I am trying to do here is use the WriteAllText. Now here is the deal:

If I, for example, write all text to some location with text 'Test' inside it, it does it normally...BUT when I do it AGAIN and write for example 'Test2' I want the original 'Test' to be overwritten by 'Test2'. So I only want 'Test2' to be in new text, not 'TestTest' which I get now. So how I do it:

My.Computer.FileSystem.WriteAllText ("C:\test.txt", "Test", true)   


and then after it

My.Computer.FileSystem.WriteAllText ("C:\test.txt", "Test2", true)   


and what I get in text file is: "TestTest2".

Hope you know how to solve this!

Thanks in advance,

Koyac

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>