I am processing some CSV file which i have copied in Bin folder of My ASP.NET Website.
When i execute
using (IDataReader csv = new CsvReader
(new StreamReader("sample.txt"), true, '|'))
{
.....
}
it complains me that "sample.txt" not found in “c:\Program Files\.....\“
Won’t the runtime automatically look into the bin folder?
what modification do i need to do?
You need to specify a full path by calling
Server.MapPath:However, you should not put anything in the
binfolder other than assemblies.You should use the
App_Datafolder instead.