while (file.Peek() > -1) { line = file.ReadLine().Trim(); if (line.IndexOf(";") > -1) line = line.Substring(0, line.IndexOf(";")); if (line == "") { continue; } else if (line.StartsWith("[")) { } else { string propertyname = line.Substring(0, line.IndexOf("=")).ToLower().Trim(); line = line.Replace(propertyname, "").Trim(); string propertyvalue = line.Substring(line.IndexOf("=") + 1).Trim().ToLower(); switch (propertyname) { case "canreinvite": CanReinvite = (propertyvalue == "yes"); break; case "context": Context = propertyvalue; break; case "defaultexpirey": defaultexpirey = Int32.Parse(propertyvalue); break; case "fromdomain": FromDomain = propertyvalue; break; case "localnet": LocalNet = propertyvalue; break; case "maxexpirey": MaxExpirey = Int32.Parse(propertyvalue); break; case "nat": Nat = (propertyvalue == "yes"); break; case "notiftymimetype": NotifyMIMEType = propertyvalue; break; case "pedatic": Pedatic = (propertyvalue == "yes"); break; case "port": Port = Int32.Parse(port); break; case "srvlookup": SrvLookup = (propertyvalue == "yes"); break; case "tos": TOS = propertyvalue; break; case "trustrpid": TrustRPID = propertyvalue; break; case "useragent": UserAgent = propertyvalue; break; case "videosupport": VideoSupport = propertyvalue; } }