Click here to Skip to main content
15,887,812 members
Home / Discussions / C#
   

C#

 
GeneralRe: html in C# Pin
Pete O'Hanlon11-Aug-09 0:26
mvePete O'Hanlon11-Aug-09 0:26 
AnswerRe: html in C# [modified] Pin
0x3c010-Aug-09 23:32
0x3c010-Aug-09 23:32 
QuestionHow to load a button in taskbar through c# Pin
svt gdwl10-Aug-09 22:34
svt gdwl10-Aug-09 22:34 
AnswerRe: How to load a button in taskbar through c# Pin
Arindam Sinha10-Aug-09 23:07
Arindam Sinha10-Aug-09 23:07 
Questioncallbackoncollected delegated data Pin
Rajee Maharjan10-Aug-09 22:28
Rajee Maharjan10-Aug-09 22:28 
QuestionValidation on Texboxes dialog in Setup and deployment project Pin
248912810-Aug-09 21:53
248912810-Aug-09 21:53 
AnswerRe: Validation on Texboxes dialog in Setup and deployment project Pin
Arindam Sinha10-Aug-09 22:58
Arindam Sinha10-Aug-09 22:58 
Questionhow ı can do "I delete old folder with hours but my prog delete days" Pin
mehmetbilge10-Aug-09 21:23
mehmetbilge10-Aug-09 21:23 
this is my prog


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DeleteOldFiles
{
public class DeleteOldFiles

{
private static double fileCount = 0;
static void Main(string[] args)
{
double DaysOld;
if (args.Length != 2
|| !double.TryParse(args[0], out DaysOld)
|| !Directory.Exists(args[1]))
{
displayUsage();
return;
}

deleteOldFiles(args[1], DaysOld);
}

static private void deleteOldFiles(string path, double DaysOld)
{
System.Console.WriteLine(String.Format("Deleting files older than {0} days", DaysOld));
deleteOldFiles(path, DateTime.Now.AddDays(-DaysOld));
System.Console.WriteLine(String.Format("{0} files deleted", fileCount));
}

static private void deleteOldFiles (string path, DateTime olderThanDate)
{
DirectoryInfo dirInfo = new DirectoryInfo(path);

FileInfo[] files = dirInfo.GetFiles();
foreach (FileInfo file in files)
{
if (file.LastWriteTime < olderThanDate)
{
System.Console.WriteLine(String.Format("Delete {0}.",file.FullName));
file.IsReadOnly = false;
file.Delete();
fileCount++;
}
}

// Now recurse down the directories
DirectoryInfo[] dirs = dirInfo.GetDirectories();
foreach (DirectoryInfo dir in dirs)
{
deleteOldFiles(dir.FullName, olderThanDate);
}
}

static private void displayUsage()
{
string message = "del.exe <path>
AnswerRe: how ı can do "I delete old folder with hours but my prog delete days" Pin
0x3c010-Aug-09 21:57
0x3c010-Aug-09 21:57 
Questiondata gridview editing Pin
abdolrab10-Aug-09 21:03
abdolrab10-Aug-09 21:03 
AnswerRe: data gridview editing Pin
padmanabhan N10-Aug-09 22:32
padmanabhan N10-Aug-09 22:32 
QuestionCombobox Control Pin
elci10-Aug-09 20:33
elci10-Aug-09 20:33 
AnswerRe: Combobox Control Pin
padmanabhan N10-Aug-09 22:33
padmanabhan N10-Aug-09 22:33 
QuestionProblem in using namespace in c# Pin
DIPAK@EMSYS10-Aug-09 20:16
DIPAK@EMSYS10-Aug-09 20:16 
AnswerRe: Problem in using namespace in c# Pin
SeMartens10-Aug-09 20:21
SeMartens10-Aug-09 20:21 
GeneralRe: Problem in using namespace in c# Pin
DIPAK@EMSYS10-Aug-09 21:34
DIPAK@EMSYS10-Aug-09 21:34 
GeneralRe: Problem in using namespace in c# Pin
Henry Minute11-Aug-09 0:29
Henry Minute11-Aug-09 0:29 
GeneralRe: Problem in using namespace in c# Pin
DIPAK@EMSYS11-Aug-09 17:57
DIPAK@EMSYS11-Aug-09 17:57 
QuestionDateTimePicker Pin
elci10-Aug-09 20:03
elci10-Aug-09 20:03 
AnswerRe: DateTimePicker Pin
dan!sh 10-Aug-09 20:35
professional dan!sh 10-Aug-09 20:35 
QuestionHow To change the path of "user.config" Pin
shaktisinh10-Aug-09 19:25
shaktisinh10-Aug-09 19:25 
QuestionHow can I add .Net framework along with setup project Pin
Milind Panchal10-Aug-09 19:20
Milind Panchal10-Aug-09 19:20 
AnswerRe: How can I add .Net framework along with setup project Pin
dan!sh 10-Aug-09 19:24
professional dan!sh 10-Aug-09 19:24 
Questionfiltering Bulk data Pin
333soori10-Aug-09 18:53
333soori10-Aug-09 18:53 
AnswerRe: filtering Bulk data Pin
Toshiya TSURU10-Aug-09 20:09
Toshiya TSURU10-Aug-09 20:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.