Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to delete a file?

Tags:

c#

.net

How do I delete a file, given the full path to the file?

like image 563
mahesh Avatar asked Sep 03 '10 12:09

mahesh


People also ask

How do I delete a file that Cannot be deleted?

Use Shift + Delete to Force Delete File/Folder. You can select the target file or folder and press Shift + Delete keyboard shortcut to delete the file/folder permanently. This file deletion method won't pass the Recycle Bin.

How do I delete files in a folder?

Locate the item you want to delete, highlight it by left-clicking the file or folder with your mouse once, and press the Delete key.


1 Answers

You want File.Delete.

File.Delete(@"C:\Documents and Settings\Vijay.EKO-03\Desktop\blockseek3-9-2010\Block3.xml");
like image 99
Joe White Avatar answered Nov 14 '22 23:11

Joe White