0

I need help and this is not giving me any errors but it is not working either :/

If someone can help I would appreciate it.

WebRequest request = WebRequest.Create("http://sitebuilder.yola.com/restricted_view/site_design/8a4986ca3fa8df50013fb4a713810fe3/resources/program_hudtool/version_hudtool.txt");
WebResponse response = request.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream());
string newestversion = sr.ReadToEnd();
string currentversion = Application.ProductVersion;

if (newestversion.Contains(currentversion))
{
this.Text = "Test [Version 0.5] | No Update Available";
}
else
{
this.Text = "Test [Version 0.5] | Update Available: " + sr.ReadToEnd();
}
4

1 回答 1

0

首先确保您从两端(网络和本地)获得正确的版本。

string newestversion = sr.ReadToEnd();
string currentversion = Application.ProductVersion;

//Test if both versions are valid.
//Debug.WriteLine(newestversion );
//Debug.WriteLine(currentversion );

Version vOnline=new Version(newestversion)
Version vLocal=new Version(currentversion )

if(vOnline > vLocal)
{
}
else
{
}
于 2013-07-15T03:55:02.473 回答