Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions Source/RatioMaster/VersionChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class VersionChecker
public const string LocalVersion = "0430";
public const string PublicVersion = "0.43";
public const string ReleaseDate = "08-01-2016";
private const string ProgramPageVersion = "http://ratiomaster.net/vc.php?v=";
private const string ProgramPageVersion = "https://github.com/NikolayIT/RatioMaster.NET/releases/latest";

private readonly string userAgent;

Expand Down Expand Up @@ -58,20 +58,16 @@ public bool CheckNewVersion()

public string GetServerVersionId()
{
var url = ProgramPageVersion + LocalVersion;
var url = ProgramPageVersion;
try
{
var request1 = (HttpWebRequest)WebRequest.Create(url);
request1.UserAgent = this.userAgent;
request1.Timeout = 2500;
using (var response1 = (HttpWebResponse)request1.GetResponse())
{
using (var reader1 = new StreamReader(response1.GetResponseStream()))
{
var data = reader1.ReadToEnd();
return data;
}
}
var response1 = request1.GetResponse();
var data = response1.ResponseUri.ToString();
data = data.Substring(data.Length - 4, 4);
return data;
}
catch (Exception exception1)
{
Expand Down