//调用ResXResourceReader类,需要引用System.Windows.Forms.dll,下同

ResXResourceReader resxReader = new ResXResourceReader(@"资源文件路径");
IDictionaryEnumerator dict = resxReader.GetEnumerator();


StringBuilder jsonBuilder = new StringBuilder("{\"th_th\": {");
while (dict.MoveNext())
{
Console.WriteLine("{0},{1}", dict.Key, dict.Value);
jsonBuilder.Append("\"" + dict.Key + "\":\"" + dict.Value + "\",\n");
}
var jsonString = jsonBuilder.ToString().Substring(0, jsonBuilder.Length - 2) + "}}";

var path = Directory.GetCurrentDirectory();

File.WriteAllText(path + "/th_th.json", Regex.Unescape(jsonString));

 

相关文章:

  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2021-11-25
  • 2021-12-10
  • 2021-08-06
  • 2021-10-12
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-01-18
  • 2023-01-25
  • 2022-12-23
相关资源
相似解决方案