PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Removing a file with VB.NET Program

Reply

Removing a file with VB.NET Program

 
Thread Tools Rate Thread
Old 04-04-2006, 09:02 AM   #1
Joris De Groote
Guest
 
Posts: n/a
Default Removing a file with VB.NET Program


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


  Reply With Quote
Old 04-04-2006, 09:19 AM   #2
Josef Brunner
Guest
 
Posts: n/a
Default Re: Removing a file with VB.NET Program

Hi,

"Joris De Groote" <joris.degroote@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


  Reply With Quote
Old 04-04-2006, 09:22 AM   #3
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Removing a file with VB.NET Program

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/li...ile.delete.aspx

I hope this helps,

Cor

"Joris De Groote" <joris.degroote@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
>



  Reply With Quote
Old 04-04-2006, 11:50 AM   #4
Joris De Groote
Guest
 
Posts: n/a
Default Re: Removing a file with VB.NET Program

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]" <notmyfirstname@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/li...ile.delete.aspx
>
> I hope this helps,
>
> Cor
>
> "Joris De Groote" <joris.degroote@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
>>

>
>



  Reply With Quote
Old 04-04-2006, 12:09 PM   #5
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Removing a file with VB.NET Program

"Joris De Groote" <joris.degroote@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/>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off