C# 读取json文件
//FinstrID为json文件中的key值
var js = Readjson("FinstrID");
public static string Readjson(string key) { string jsonfile = "HPVTest.Designer.json";//JSON文件路径 using (System.IO.StreamReader file = System.IO.File.OpenText(jsonfile)) { using (JsonTextReader reader = new JsonTextReader(file)) { JObject o = (JObject)JToken.ReadFrom(reader); var value = o[key].ToString(); return value; } } }