Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

Am trying to delete a file on the web server. This particular file has been downloaded from the server to my local machine. I had been using the command:

File.Delete("C:\Temp\test.txt")

But this does not seem to be deleting the file.

 

Any suggestions??

 

Mike55

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Posted

Thanks for the reply PlausiblyDamp,

 

I found the solution to my problem. Here's what I was doing:

1. Retrieve all my data from the database and write it to a .CSV file.

2. Offer the user the choice of either Saving, Opening or Cancel the .CSV file.

3. Whatever option the user selected, I would then delete the .CSV file from my web server.

 

The problem is that when the "Save, Open, Cancel" dialog appeared, no other code would run after that.

 

So here is what I did,

1. Use a file stream to read the data from the .CSV file.

2. Delete the file on the web server.

3. Write the data in the file stream to the users location if they choose the Save or Open option.

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...