📅  最后修改于: 2022-03-11 14:59:15.937000             🧑  作者: Mango
public class FileReader
{
private readonly IHostingEnvironment env;
public FileReader(IHostingEnvironment env)
{
if(env==null)
throw new ArgumentNullException(nameof(env));
this.env = env;
}
public string ReadFile(string fileName)
{
var filename = Path.Combine(env.WebRootPath, fileName);
}
}