file cannot be delete from asp.net
<p>Hello guys I a webproject in asp.net my project worked fine in my pc but after uploading it to a iis server it is not working.
My webproject is to delete a file,</p>

<pre><code>string s;
    int i;
    s = Environment.GetEnvironmentVariable("temp"); ;

            string[] prefetchtlist = System.IO.Directory.GetFiles(s, "*.*");

                for (i = 0; i &lt; prefetchtlist.Length; i++)
                {
                    try
                    {
                        System.IO.File.Delete(prefetchtlist[i]);
                    }
                    catch (Exception)
                    {
                        i++;
                    }
                }


    Label1.Text = "Completed";
</code></pre>
