mirror of
https://github.com/kwsch/NHSE.git
synced 2026-09-27 04:19:36 -05:00
Bump netcore usages to net5
nhse.core still is netstandard2.0 only tests/sprites/winforms got bumped
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user