Getting Started

After downloading (Download here: https://inireader.codeplex.com/releases and adding the InIReader to your project, is here the "Hello World" for ini files.

For more Information you may want to go here: Function Overview.
If you are interested in the InIReader you'll find the answers there InIReader Editor

Hello World

using System;
using ini;

public class HelloWorld
{
   public static void Main(params string[] args)
   {
	InIReader reader = new InIReader();
	
	reader["Hello"]["World"] = "A small file";

	for (int i = 0; i < 10; i++)
	{
		reader["number"][i.ToString()] = (i * 999).ToString("x");
	}

	Console.Write(reader.ToString());
   }
}

This snippet creates a empty reader, fills it with some scrap and prints the reader to the console. Accessing the Reader via "this[string]" will either create a new entry, or change the existing one.
There is one exception: Accessing the getter with a not existing key, will cause an Exception. You can prevent the exception by using InIReader.ContainsKey(string), which will return false, if the key does not exist.

Executing the example above, you should get a result, similiar to this:
[Hello]
World=A small file

[number]
0=0
1=3e7
2=7ce
3=bb5
4=f9c
5=1383
6=176a
7=1b51
8=1f38
9=231f

Pretty easy, isn't it? But wait, there is more:
You can find more Information about adding and changing the readers value's here:

Last edited Dec 19, 2012 at 9:26 PM by IqonX, version 4

Comments

No comments yet.