Saturday, 31 August 2013

Directory Getfiles retrieve wrong files path

Directory Getfiles retrieve wrong files path

I'm trying to access to the path in my application.From
frm_VerifyIndentity.aspx.cs to Imgs folder.

I'm using next below code:
string pathRepositories = Request.ApplicationPath + "/IVT/Imgs/";
where the value of Request.ApplicationPath is
/IVT
And I pass this parameter to
DirectoryInfo directory = new DirectoryInfo(pathRepositories);
FileInfo[] files = directory.GetFiles("*.jpg");
Where the pathRepositories is concatenation:
/IVT/IVT/Imgs/
But, the strange, because when I check the value where the directory is
looking for, the values is next below
C:\IVT\IVT\Imgs\ instead of my pathapplication.
Thta's why I get next below error:

Somebody know why?

No comments:

Post a Comment