How will delete the file using c#?
<p>I want to delete file using the delete function.</p>

<pre><code>     foreach (string file1 in filePaths)
        {
            file = Path.GetFileName(file1);

            while (reader.Read())
            {
                client = reader["name"].ToString();
                filename = reader[2].ToString();

                if (filename != file)
                    flag = 1;

                else
                    flag = 0;

            }
            if (flag == 1)
            {
                sw.WriteLine(file);

                File.Delete(file);   

                data_count++;
            }


       } 
</code></pre>

<p>My file is not deleting.</p>
