Tuesday, May 6, 2014

Delete File in C#

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

namespace shutdown
{
    class Program
    {
        static void Main(string[] args)
        {
            string files = @"L:\anh tambov\100NCD90";
            string filedel = @"*.NEF";
            string[] filelist = Directory.GetFiles(files, filedel);
            foreach(string file in filelist)
            {
                File.Delete(file);
            }
            Console.ReadLine();
        }
    }
}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home