https://github.com/winscripter/resx-net
Reads, writes, and converts ResX files without any dependencies
https://github.com/winscripter/resx-net
csharp dotnet resource resources resx resx-files resx-resources xml
Last synced: 6 months ago
JSON representation
Reads, writes, and converts ResX files without any dependencies
- Host: GitHub
- URL: https://github.com/winscripter/resx-net
- Owner: winscripter
- License: mit
- Created: 2024-09-10T12:53:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-10T12:59:32.000Z (almost 2 years ago)
- Last Synced: 2025-07-12T10:34:28.582Z (12 months ago)
- Topics: csharp, dotnet, resource, resources, resx, resx-files, resx-resources, xml
- Language: C#
- Homepage:
- Size: 63.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ResX.NET
NuGet: https://nuget.org/packages/ResX.NET
Easy manipulation of ResX files.
Runs on .NET 6.0 and later. Cross platform and high performance.
To load an existing ResX file:
```cs
var resx = new ResXFile(ResXFile.Parse(File.ReadAllText("SomeFile.resx")));
foreach (ResXData data in resx.DataList)
{
// Do something with data
}
```
To write a ResX file:
```cs
var resx = new ResXFile();
resx.DataList.Add(new ResXData(Name: "Greeting", Value: "Hello, World!", Comment: null));
string result = resx.Build(); // Returns the string representation
File.WriteAllText("result.resx", result);
```
To convert ResX files:
```cs
ResXFile resx = /*...*/;
Console.WriteLine(ResXConvert.ToCSharp(resx));
Console.WriteLine(ResXConvert.ToMarkdown(resx));
Console.WriteLine(await ResXConvert.ToJsonAsync(resx));
```