windows service file delete c#
<p>windows service example code</p>

<pre><code>using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.IO;
namespace file_delete
{
    public partial class file_delete : ServiceBase
    {  
        public file_delete()
        {
            InitializeComponent();
        }
        protected override void OnStart(string[] args)
        {           
        }
        private void deleteFile(string folder)
        {
         System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(folder);
         System.IO.FileInfo[] fileNames = dirInfo.GetFiles("*.*");
           foreach (System.IO.FileInfo fi in fileNames)
           {              
               fi.Delete();               
           }
</code></pre>

<p>How can I call the <strong>deleteFile(string folder)</strong> from windows forms?</p>
