In Form1 I have:
satelliteMapToRead = File.ReadAllText(localFilename + "satelliteMap.txt");
Then in the constructor:
ExtractImages.ExtractDateTime("image2.ashx?region=eu&time=", "&ir=true", satelliteMapToRead);
Then in the ExtractImages class i have:
public static void ExtractDateTime(string firstTag, string lastTag, string f)
{
int index = 0;
int t = f.IndexOf(firstTag, index);
int g = f.IndexOf(lastTag, index);
string a = f.Substring(t, g - t);
}
This an example of a string in the text file:
image2.ashx?region=eu&time=201309202145&ir=true
From this string i want that the variable g will contain only: 201309202145 And then to convert the variable a to date time : date 2013 09 20 - time 21 45
What I get in the variable a now is:
image2.ashx?region=eu&time=201309202215
And it's not what I need.