C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to make the folder empty on condition


Posted Date: 07 Oct 2006      Total Responses: 1

Posted By: fairy sheikh       Member Level: Bronze     Points: 2


i have a folder in my solution explorer named "Error Log" and i am placing in it the txt files with the name same as the curent date.......

now i have placed a condition there.....that if the files in this folder exceed from 7....then the folder "Error Log" should be again set to emptyy....having no files......and the next file saved will be the first one in the folder.

and i am not getting how to delete all the files in the folder on the condition and make it empty




Responses

Author: mitul    07 Oct 2006Member Level: SilverRating:     Points: 2
hello
i am try but not solve your problem
your question is nice i like it
i give one advise
first delete this folder and after create

Directory.CreateDirectory("c:\\mitul");
DirectoryInfo del = new DirectoryInfo("c:\\mitul");
del.Delete(false);

and another plz try

string del;
del=Directory.GetFiles("c:\\mitul").ToString();

del="c:\\mitul"+ "\\"+ del;
Response.Write(del);
File.Delete(del);


Post Reply
You must Sign In to post a response.
Next : Displaying of no. of textboxes in runtime
Previous : how to get the last month,year,date in asp.net
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

UK Conference calling Company

Contact Us    Privacy Policy    Terms Of Use