Home All Groups Group Topic Archive Search About

Removing a file with VB.NET Program

Author
4 Apr 2006 8:02 AM
Joris De Groote
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

Author
4 Apr 2006 8:19 AM
Josef Brunner
Hi,

"Joris De Groote" <joris.degro***@skynet.be> schrieb im Newsbeitrag
news:uA$dw47VGHA.5668@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
Author
4 Apr 2006 8:22 AM
Cor Ligthert [MVP]
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/library/system.io.file.delete.aspx

I hope this helps,

Cor

Show quoteHide quote
"Joris De Groote" <joris.degro***@skynet.be> schreef in bericht
news:uA$dw47VGHA.5668@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
>
Author
4 Apr 2006 10:50 AM
Joris De Groote
Thanks!
I was looking @ system.io.delete of something, didn't think there had to be
file in it to.

Greetz
Joris
Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OsiXlC8VGHA.4148@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/library/system.io.file.delete.aspx
>
> I hope this helps,
>
> Cor
>
> "Joris De Groote" <joris.degro***@skynet.be> schreef in bericht
> news:uA$dw47VGHA.5668@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
>>
>
>
Author
4 Apr 2006 11:09 AM
Herfried K. Wagner [MVP]
"Joris De Groote" <joris.degro***@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/>