i want to be able to operate .resx files in the management dashboard
on the internet, i found and tested the codes related to the multilingualization of the site, and now I want to update them in the management panel.
CodePudding user response:
install packege:
ResXResourceReader.NetStandard Version="1.1.0"
use code :
// address Resources.resx
var reader = new ResXResourceReader(filename);
var node = reader.GetEnumerator();
var writer = new ResXResourceWriter(fileName);
while (node.MoveNext())
{
writer.AddResource(node.Key.ToString(), node.Value.ToString());
}
var newNode = new ResXDataNode(name, value);
writer.AddResource(newNode);
writer.Generate();
writer.Close();