Bump netcore usages to net5

nhse.core still is netstandard2.0
only tests/sprites/winforms got bumped
This commit is contained in:
Kurt
2020-12-02 21:35:24 -08:00
parent 6fbff26184
commit c027a2cb44
12 changed files with 22 additions and 17 deletions

View File

@@ -71,7 +71,7 @@ private void B_Download_Click(object sender, EventArgs e)
private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) => PBar_MultiUse.Value = e.ProgressPercentage;
private void Completed(object sender, AsyncCompletedEventArgs e)
private void Completed(object? sender, AsyncCompletedEventArgs e)
{
if (e.Error != null)
{
@@ -138,8 +138,13 @@ private async void CheckNetworkFileSizeAsync()
{
using var webClient = new WebClient();
await webClient.OpenReadTaskAsync(new Uri(AllHosts[CB_HostSelect.SelectedIndex], UriKind.Absolute)).ConfigureAwait(false);
var totalSizeBytes = Convert.ToInt64(webClient.ResponseHeaders["Content-Length"]);
var hdr = webClient.ResponseHeaders?["Content-Length"];
if (hdr == null)
{
L_FileSize.Text = "Failed.";
return;
}
var totalSizeBytes = Convert.ToInt64(hdr);
var totalSizeMb = totalSizeBytes / 1e+6;
L_FileSize.Text = $"{totalSizeMb:0.##}MB";
}