By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,476 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,476 IT Pros & Developers. It's quick & easy.

Removing a file with VB.NET Program

P: n/a
Hi,

I have created a file in my VB.NET program, now at the end, I want to delete
that file again. How can I do this (I have in my variable 'textbestand'
where the file is located)

Thanks
Joris
Apr 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

"Joris De Groote" <jo************@skynet.be> schrieb im Newsbeitrag
news:uA**************@TK2MSFTNGP15.phx.gbl...
How can I do this (I have in my variable 'textbestand' where the file is
located)


My.Computer.FileSystem.DeleteFile("C:\test.txt")
Greets,Kurt
Apr 4 '06 #2

P: n/a
Joris,

Have a look at the file class. Be sure that you have closed the file before
you use that.

http://msdn2.microsoft.com/en-us/lib...le.delete.aspx

I hope this helps,

Cor

"Joris De Groote" <jo************@skynet.be> schreef in bericht
news:uA**************@TK2MSFTNGP15.phx.gbl...
Hi,

I have created a file in my VB.NET program, now at the end, I want to
delete that file again. How can I do this (I have in my variable
'textbestand' where the file is located)

Thanks
Joris

Apr 4 '06 #3

P: n/a
Thanks!
I was looking @ system.io.delete of something, didn't think there had to be
file in it to.

Greetz
Joris
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Os**************@TK2MSFTNGP15.phx.gbl...
Joris,

Have a look at the file class. Be sure that you have closed the file
before you use that.

http://msdn2.microsoft.com/en-us/lib...le.delete.aspx

I hope this helps,

Cor

"Joris De Groote" <jo************@skynet.be> schreef in bericht
news:uA**************@TK2MSFTNGP15.phx.gbl...
Hi,

I have created a file in my VB.NET program, now at the end, I want to
delete that file again. How can I do this (I have in my variable
'textbestand' where the file is located)

Thanks
Joris


Apr 4 '06 #4

P: n/a
"Joris De Groote" <jo************@skynet.be> schrieb:
I have created a file in my VB.NET program, now at the end, I want to
delete that file again. How can I do this (I have in my variable
'textbestand' where the file is located)


'Kill(<file name>)'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 4 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.