Amigo,
I have two version numbers. Neither of them are the version numbers of a
desktop file. One is stored in the desktop registry. The other is stored
on
the Pocket PC's registry.
How does your solution solve this problem?
--
Robert W.
Vancouver, BC
www.mwtech.com
Pohihihi said:
you are working too hard. you can just use
Environment.Version.CompareTo(object version)
Robert W. said:
I decided to write my own comparison method. I'm posting it here as it
may
prove useful to someone in the future:
public static int CompareVersionNumbers(string ver1, string ver2)
{
if (ver1 == ver2)
return 0;
string[] ver1List = ver1.Split(new char[] {'.'});
string[] ver2List = ver2.Split(new char[] {'.'});
for (int i = 0; i < ver1List.Length; i++)
{
int item1 = Convert.ToInt32(ver1List);
int item2 = Convert.ToInt32(ver2List);
if (item1 < item2)
return -1;
else if (item1 > item2)
return 1;
// If the two items are identical then iterate to next pair in
the
sequence
}
// Will never reach here but the next statement is needed in order
to
compile
return 0;
}