/// <summary>
 /// Fetches the Current Release Version From Github
 /// </summary>
 /// <returns></returns>
 public string GetVersion()
 {
     try
     {
         //This needs to be added on every call
         WebClient.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2");
         string url = $"https://api.github.com/repos/{_repositoryName}/releases/latest";
         Logger.LogDebug("[API] - Fetching " + url);
         string json = WebClient.DownloadString(url);
         Logger.LogFine("[API] - " + json);
         string version = FromJson(json)?.tag_name;
         Logger.LogDebug("[API] Version Found: " + version);
         return(version);
     }
     catch (Exception ex)
     {
         Logger.LogError("Failed to fetch url with error: \n" + ex);
     }
     return(string.Empty);
 }
예제 #2
0
 internal static void LogFine(string message) => L.LogFine(prefix + message);