简体   繁体   中英

How to access a file placed in a generic Folder inside of an ASP.NET Web Application

I am trying to get the path of a file placed in a Folder Named ProductCatalog and the file is ProductsFile.xlsx. I want to give its path in a connection string for accessing and excel file. How can i do that? Following is the string in which i am trying to place the path of the data Source What should i write after the Comma ?:

constr = string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0 Xml;HDR=YES""",   ));

试试看

string xlsNameWitPath = Path.Combine(Server.MapPath("~/ProductCatalog/"), xlsFileName);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM