I was bored so I made a dll to read your Ini files.
all you need is to add the dll as a reference to your project and start using it.
an example:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IniFile;
namespace Test {
internal class Program {
private static void Main(string[] args) {
var ini = new CIniFile("test.ini", "AccountServer");
int port = ini.GetInt("ACCOUNT_SERVER_PORT");
ini.SetSection("Game_DataBase");
string test = ini.GetString("DATABASE_HOST");
Console.WriteLine("values are {0} , {1}", port, test);
Console.ReadKey();
}
}
}
test.ini
Code:
[AccountServer]
ACCOUNT_SERVER_IP=5.230.189.19
ACCOUNT_SERVER_PORT=9958
[Account_DataBase]
DATABASE_HOST=127.0.0.1
DATABASE_USER=root
DATABASE_PASSWORD=
DATABASE_DBNAME=account_zf
DATABASE_PORT=3306
[GameServer]
GAME_SERVER_NAME=Unkown
GAME_SERVER_IP=5.230.189.19
GAME_SERVER_PORT=5816
[Game_DataBase]
DATABASE_HOST=127.0.0.1 // this is the db ip
DATABASE_USER=root
DATABASE_PASSWORD=
DATABASE_DBNAME=account_zf
DATABASE_PORT=3306
output:
Code:
values are 9958 , 127.0.0.1
Features:
-Managed (no native calls);
-You can comment your fields.
-Works on anyCPU maybe any platform :P.
-Reads Multiple sections.
okey test it , and if there is any issue please let me know so I can fix it.
Why would you want to keep yourself away from Native calls? .-.
1. Native calls may be really slow...
2. Native calls aren't made for INI file, but for the Windows Registry.
3. The second point give another problem. Each time you call a function, the file is completely loaded for the call... Really not optimal.
...xml? Basically the replacement for ini files?? ie. Welcome to the 21st century??
Not necessary. Ini is far easier to read than reading a xml file, so if you have a lot of configurations, it would be much faster configuring an inifile than xml. However xml is faster parsing for programming and much easier to use at that part as well, but performance doesn't matter much at loading configs, unless you load configurations multiple times during your process.
There's practically no difference in readability unless your a complete moron who doesn't understand simple syntax, if anything its clearer to read if your sensible about your syntax.
And as for performance its not even worth thinking about, at no point should you need to be worrying about how long it takes you to parse a .ini or .xml file, if your worrying about it then you need to rethink what your doing entirely.
Honestly do like the rest of the programmers in the world and let old technology die (surprisingly enough that's why the .net framework doesn't have any managed methods for ini files -.-")
There's practically no difference in readability unless your a complete moron who doesn't understand simple syntax, if anything its clearer to read if your sensible about your syntax.
And as for performance its not even worth thinking about, at no point should you need to be worrying about how long it takes you to parse a .ini or .xml file, if your worrying about it then you need to rethink what your doing entirely.
Honestly do like the rest of the programmers in the world and let old technology die (surprisingly enough that's why the .net framework doesn't have any managed methods for ini files -.-")
I'm not saying I am doing it, was just saying why he could be doing it. I'm using xml at its best lmao.
[Release]Metin2 Pong & Key Reader 05/01/2013 - Metin2 PServer Guides & Strategies - 611 Replies Abend Elitepvpers,
Wie zuvor erwähnt Release Ich mein Metin2 KeyManager der Pong & Key liest.
http://img846.imageshack.us/img846/3704/keymanage r02.th.png
Verwendung:
Mit dem Pong könnt Ihr mit einem modifizierten Orginal DE Ordner auf einen Privat Server connecten, Ihr müsst jedoch selbstständig die serverinfo anpassen.
Mit dem Key könnt Ihr einen Entpacker für einen Privat Server Client erstellen lassen, somit könnt ihr einfach an benötigte Dateien gelangen, selbst wenn dieser...
[RELEASE]Metin2 Soulstone Reader [ENG/GER] 09/03/2011 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 10 Replies Hey Leute Ich hab einen Seelibot erstellt wo man afk gehen kann usw. da ist nch ein video guckt es euch an!
Version 1.0: Schrott
Version 2.0: 2x auf Zen-Bohnen (Auf RSMt2 verbessern die zenbohnen 5k)
Version 3.0: max 10x auf Zen-Bohnen (Auf manchen Servern verbessern die Zen-Bohnen nur 1-2k)
und ich Hoffe das es jez klappt!
Diesen Bot hab ich erstellt damit man afk gehen kann! ihr sollt nicht vor dem Com oder Leppi sitzen und alles angucken bis die Fertigkeit P ist!
Ich gehe immer AFK...
[Release] InI File Reader 06/28/2009 - CO2 PServer Guides & Releases - 2 Replies Well This Should be All.