1 Replies - 360 Views - Last Post: 05 January 2013 - 02:10 PM Rate Topic: -----

#1 Koyax  Icon User is offline

  • D.I.C Head

Reputation: -13
  • View blog
  • Posts: 61
  • Joined: 08-November 11

'WriteAllText' doesn't overwrite the exsisting

Posted 05 January 2013 - 04:28 AM

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

Is This A Good Question/Topic? 0
  • +

Replies To: 'WriteAllText' doesn't overwrite the exsisting

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: 'WriteAllText' doesn't overwrite the exsisting

Posted 05 January 2013 - 02:10 PM

This really easy to solve, if you look at the parameters the methods takes in.
You may also want examine the documentation on the MSDN
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1