473,394 Members | 1,813 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,394 software developers and data experts.

Delete all file using * symbol

Hello,

I would like to create program which delete files using * symbol. I tried
to use this code but it is not working:
File.Delete(@"d:\example.*");//filename example, directory everthing, it
stop here : file not found

Any idea?

Thanks
Pujo

--
Baby Step, One Step at a time, better and better....
Nov 16 '05 #1
2 1757
use System.IO.Directory.GetFiles to get a list of files that match the
pattern and delete them one at a time using File.Delete.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Pujo Aji" <aj****@yahoo.com> wrote in message
news:opsksh7faed3sg8l@ajinote...
Hello,

I would like to create program which delete files using * symbol. I tried
to use this code but it is not working:
File.Delete(@"d:\example.*");//filename example, directory everthing, it
stop here : file not found

Any idea?

Thanks
Pujo

--
Baby Step, One Step at a time, better and better....
Nov 16 '05 #2

Thank you, it is working fine.

Pujo

On Tue, 18 Jan 2005 00:44:25 -0800, Nick Malik [Microsoft]
<ni*******@hotmail.nospam.com> wrote:
use System.IO.Directory.GetFiles to get a list of files that match the
pattern and delete them one at a time using File.Delete.


--
Baby Step, One Step at a time, better and better....
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Herman | last post by:
Hi everyone, I have a multiple file project for a class assignment. It consists of a class Point, then a class Polygon which uses the Point object, then a class Picture that uses the Polygon...
0
by: Jason | last post by:
I have a table, SecurityMasterUnderlying, that has a 2 foreign key constraints to the same table (SecurityMaster). The first one is a one-to-one relationship. The second being a many-to-one. *...
3
by: Ney André de Mello Zunino | last post by:
Hello. I would appreciate if somebody could assist me with an error message I am getting from the Microsoft WinDbg 6.3 debugging tool. I am not familiar with it, since I have just downloaded it....
0
by: crafuse | last post by:
Hello all, I'm trying to create a mixed DLL using VC++ .NET 2003. Specifically, I have some TAO CORBA .cpp files that I wish to include as native object code in the DLL and some managed classes...
22
by: Cylix | last post by:
I have a 4row x 1col table, I would like to drop all the content of row three. Since Mac IE5.2 does not suppport deleteRow method, I have also try to set the innerHTML=''; but it does not work. ...
7
by: Defected | last post by:
Thanks all for help, I have tried this code but it's don't work. -------------------------------------------------------------------- Structure typedef struct{ int atomic_number; char...
2
by: Andrew West | last post by:
Probably a bit of weird question. I realise decorators shouldn't be executed until the function they are defined with are called, but is there anyway for me to find all the decorates declared in a...
17
by: Nick Keighley | last post by:
Hi, I have a map containing pointers. When I destroy the map I want to delete all the pointers. typedef std::map<std::string, const T*Table; void destroy_map () {
31
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.