https://github.com/anas-araid/iniserializer
Class that serializes an object into a string that can be saved to an ini file
https://github.com/anas-araid/iniserializer
c-sharp csharp ini serializer
Last synced: 5 months ago
JSON representation
Class that serializes an object into a string that can be saved to an ini file
- Host: GitHub
- URL: https://github.com/anas-araid/iniserializer
- Owner: anas-araid
- License: mit
- Created: 2018-06-04T13:52:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-11T13:31:52.000Z (about 8 years ago)
- Last Synced: 2024-12-31T06:29:30.087Z (over 1 year ago)
- Topics: c-sharp, csharp, ini, serializer
- Language: C#
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# INISerializer example
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace INI_Tester
{
class Program
{
static void Main(string[] args)
{
Rect r = new Rect();
r.a = 100;
r.b = 200;
string s = INISerializer.INISerializer.SerializeObject(r);
string path = @"path\file.ini";
try
{
File.Create(path).Dispose();
using (var tw = new StreamWriter(path, true))
{
tw.WriteLine(s);
}
}
catch(Exception)
{
}
object obj = INISerializer.INISerializer.deserializeObject(path);
}
}
class Rect
{
public int a { get; set; }
public int b { get; set; }
}
}
```