json文件存在判断

This commit is contained in:
czz_y
2024-09-09 09:10:56 +08:00
parent d3f7d2e07c
commit 4bdb338964
2 changed files with 6 additions and 1 deletions
+4
View File
@@ -12,6 +12,10 @@ namespace AntdUIDemo.Utils
{
public static JObject GetAppSettings(string configFilePath = "appsettings.json")
{
if (!File.Exists(configFilePath))
{
return null;
}
// Read the JSON file
var json = File.ReadAllText(configFilePath);