I want to compare Mozilla firefox version. So, I'm getting Mozilla version as a string. Like "50.0.2". So, I'm trying to convert that string into float type using following program, but I'm getting following an error.
Input string was not in a correct format
Code :
float f = float.Parse(MozillaVersion, CultureInfo.InvariantCulture.NumberFormat);
if (f >= 48.0) // Here, MozillaVersion = "50.0.2"
{
// code here
}
else
{
// code here
}
I'm newbie in C#. So, someone help me. Is there any way to compare mozilla version?