static public System.Collections.Specialized.NameValueCollection ReadIni(string sFileName)
{
System.Collections.Specialized.NameValueCollection coll = null;
string sTxt = cc.Util.readAll(sFileName);
if (sTxt != null)
{
coll = new System.Collections.Specialized.NameValueCollection();
string[] lines = sTxt.Replace("\n", "").Split('\r');
for (int i = 0; i < lines.Length; i++)
{
string line = lines[i].Trim();
if (line.Equals("") || line.StartsWith("#") || line.StartsWith(";"))
{
continue;
}
int npos;
npos = line.IndexOf("=");
if (npos > 0)
{
string skey = line.Substring(0, npos);
if (coll.Get(skey) != null)
{
coll.Set(skey, coll.Get(skey) + "\r\n" + line.Substring(npos + 1));
}
else
{
coll.Set(skey, line.Substring(npos + 1));
}
}
}
}
return(coll);
}