473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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
Apr 4 '06 #1
4 866
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: wes | last post by:
I just installed VS .Net 2003 and now when I try to remove something from the GAC I get the error: Unable to uninstall: assembly is required by one or more applications Pending references:...
35
by: Geronimo W. Christ Esq | last post by:
Are there any scripts or tools out there that could look recursively through a group of C/C++ source files, and allow unreferenced function calls or values to be easily identified ? LXR is handy...
11
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white...
2
by: C Glenn | last post by:
I've recompiled a DLL that contains a component. The component vanished from the form. I've since tried to replace it but most of the code associated with the component remained in the cs. The...
6
by: Brett | last post by:
I've created a Windows setup project in VS.NET 2003. The first setup ran fine minus creating the Program's group. I made some changes and rebuilt the MSI and setup.exe files. Now when I run the...
3
by: Kilicaslan Fatih | last post by:
When I push a button to trigger the code: def runCCCC(self, event): cmd_out = self.A_com() if App.runF != "": os.mkdir('C:\copiedFiles') for item in App.runF: App.beCopied = str(item)...
17
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not...
13
by: Mumia W. | last post by:
Hello all. I have a C++ program that can count the YOYOs that are in a grid of Y's and O's. For example, this Y O Y O O Y O Y O Y O O Y O Y Y O Y O Y O O Y O O Y Y O Y O
2
by: beatTheDevil | last post by:
Hey guys, As the title says I'm trying to make a regular expression (regex/regexp) for use in removing the comments from code. In this case, this particular regex is meant to match /* ... */...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.