Skip to content

Commit

Permalink
"versions between" informations added
Browse files Browse the repository at this point in the history
  • Loading branch information
WaGi-Coding committed Sep 26, 2019
1 parent 3e31660 commit 1ed389e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions WaGis IP-Blacklister/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,33 @@ protected String WaGiRequest(string url)
}
}

List<string> fullInfo;
private void Update_Load(object sender, EventArgs e)
{
try
{
Version curV = new Version(Application.ProductVersion);

jsonData = WaGiRequest("https://api.github.com/repos/WaGi-Coding/WaGis-Mass-IP-Blacklister-Windows/releases/latest");

var jsonArr = JArray.Parse(WaGiRequest("https://api.github.com/repos/WaGi-Coding/WaGis-Mass-IP-Blacklister-Windows/releases"));

fullInfo = new List<string>();

foreach (JObject jO in jsonArr)
{
if (true)
{
Version tempVersion = new Version(jO.SelectToken("tag_name").ToString());

if (curV.CompareTo(tempVersion) < 0)
{
Console.WriteLine(tempVersion);
fullInfo.Add(((jsonArr.First == jO) ? "" : "\n\n") + tempVersion.ToString() + ':');
fullInfo.Add(jO.SelectToken("body").ToString().Split(new string[] { "---" }, StringSplitOptions.None)[1].Replace('*', '●'));
}
else
{
break;
}
Console.WriteLine(jO.SelectToken("tag_name"));


}

Expand Down Expand Up @@ -113,9 +125,8 @@ private void Update_Load(object sender, EventArgs e)
btnDownload.Enabled = true;
}

string[] bodyArray = body.Split(new string[] { "---" }, StringSplitOptions.None);

richTextBox1.Text = bodyArray[1].Replace('*', '●');
//richTextBox1.Text = body.Split(new string[] { "---" }, StringSplitOptions.None)[1].Replace('*', '●');
richTextBox1.Text = string.Join("\n", fullInfo);

}
}
Expand Down

0 comments on commit 1ed389e

Please sign in to comment.