G
Guest
when i run the code below to search my entire c drive.. i get this following
error message:
Access to the path "c:\System Volume Information" is denied.
Line 29: foreach (string f in Directory.GetFiles(d, ".mp3"))
In web.config i have <identity impersonate="true"/>
When i run the same code in Windows Form it works fine, also i like to know
how i can put the results into an array instead of using response.write.
public class Search : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
DirSearch("c:\\");
}
public void DirSearch(string sDir){
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d, ".mp3"))
{
Response.Write(f);
}
DirSearch(d);
}
}
error message:
Access to the path "c:\System Volume Information" is denied.
Line 29: foreach (string f in Directory.GetFiles(d, ".mp3"))
In web.config i have <identity impersonate="true"/>
When i run the same code in Windows Form it works fine, also i like to know
how i can put the results into an array instead of using response.write.
public class Search : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
DirSearch("c:\\");
}
public void DirSearch(string sDir){
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d, ".mp3"))
{
Response.Write(f);
}
DirSearch(d);
}
}