- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
private double readDouble(string name, string wholeFile)
{
try
{
int ind = -1;
if ((ind = wholeFile.IndexOf(name)) != -1)
{
var restofstr = wholeFile.Substring(ind + name.Length);
int lineendind = -1;
lineendind = restofstr.IndexOfAny(new char[] { '\n', '\r', (char)13, (char)10 });
if (lineendind == -1 && restofstr.Length > 1)
{
lineendind = restofstr.Length;
}
if (lineendind != -1)
{
int eqind = -1;
string valueString = restofstr.Substring(0, lineendind);
if ((eqind = valueString.IndexOf("=")) != -1)
{
double res = 0.0;
if (Double.TryParse(valueString.Substring(eqind + 1).Trim(), out res))
{
return res;
}
}
}
}
}
catch (Exception) { }
return 0.0;
}