njcrawford / inifile Goto Github PK
View Code? Open in Web Editor NEWSimple .ini file parser written in C#
Home Page: http://www.njcrawford.com/programs/inifile/
Simple .ini file parser written in C#
Home Page: http://www.njcrawford.com/programs/inifile/
This was originally opened as njcrawford/EmbroideryReader#18, but it's actually a bug in IniFile.
When several copies of an application are opened, and they all try to save settings on close, and the user does "Close this group" from the taskbar, all copies try to write to the settings file at the same time and crash.
Example crash log, taken from Embroidery Reader issue 18:
Time: 2016-11-14 12:09:03
Program: embroideryReader, Version=2.2.3.0, Culture=neutral,
PublicKeyToken=null
Program location: C:\Program Files (x86)\NJCrawford
Software\Embroidery Reader\embroideryReader.exe
OS: Windows 10 Home release 1607 (6.3 build 14393) (x64)
OS Culture: en-US
Framework: 4.0.30319.42000 (x64)
Error:
System.IO.IOException (The process cannot access the file
'C:\Users[username]\AppData\Local\NJCrawford Software\Embroidery
Reader\embroideryreader.ini' because it is being used by another
process.)
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String
destFileName, Boolean overwrite, Boolean checkHost)
at NJCrawford.IniFile.save()
at embroideryReader.frmMain.Form1_FormClosing(Object sender,
FormClosingEventArgs e)
at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
at System.Windows.Forms.Form.WmClose(Message& m)
at embroideryReader.frmMain.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
When setting a value containing newlines, they can be retrieved just as they were set until being saved to a file. When the newlines are saved to file and read back, they are interpreted as separate lines and no longer parts of the value.
IniFile iniFile = new IniFile();
string value = "one
two
three";
iniFile.setValue('test', value);
iniFile.save();
// Reload file from disk
iniFile = new IniFile();
string after = iniFile.getValue('test');
At this point, after
contains "one" instead of "one\ntwo\nthree".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.