473,761 Members | 4,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1771
use System.IO.Direc tory.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.c om> wrote in message
news:opsksh7fae d3sg8l@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*******@hotm ail.nospam.com> wrote:
use System.IO.Direc tory.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
12287
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 object. Unfortunately, I cannot compile Polygon.java, because it cannot recgonise the Point object. Any ideas? (I'm using the Sun SDK 1.4.2) Thanks! (By the way, the drawing package and Canvas class were created by my instructor to make drawing to...
0
2239
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. * All securities (equities, options, futures) will have ONE row in SecurityMaster. * All derivatives (options) will also have ONE row in SecurityMasterUnderlying. * All derivatives will have an underlying security (think of it as a parent) in...
3
36492
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. However, I did check the compiler (cl.exe) and linker (link.exe) documentation for the options I should use in order to get debugging information to be generated. The test program consists of a single .cpp file. Here are the command lines I used...
0
1373
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 that will use the objects and static methods within the TAO .cpp files. I've done some homework, and I know enough to: - dissable /clr for the TAO .cpp files - dissable precompiled headers for the TAO .cpp files
22
4191
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. How can I delete the node from DOM in other way? Thanks.
7
590
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 name;
2
1953
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 file when I import it? Or perhaps anyway to find the decorators by loading the file by other methods (with out simply parsing it by hand). Basically what I'm looking for is a way to, given a python file, look through that file and find all the...
17
50517
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
6678
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 nested form. In other words, the form, m_settings_menueditor_recursive has a single subform; m_settings_menueditor_recursive (both are viewed as datasheets - so the form is its own subdatasheet.) The Form_Open event modifies the form's recordset so...
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10115
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.