我有一个Web应用程序(asmx),它使用存储在JSON文件中的API秘密。当前我已将该文件放在wwwroot / myapp /文件夹中
string htmlFilePath = HttpContext.Current.Server.MapPath("~/");
string contents = File.ReadAllText(htmlFilePath+@"\file.json");
return contents;
此文件可从浏览器公开访问。如何使该文件只能由应用程序访问?