Skip to content

Commit

Permalink
Fix work on Windows 7
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander7550 committed Jul 1, 2023
1 parent 15c0898 commit 4ca24d0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Steam Desktop Authenticator/ConfirmationFormWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Windows.Forms;
using SteamAuth;
using System.Drawing.Drawing2D;
using System.Net;

namespace Steam_Desktop_Authenticator
{
Expand Down Expand Up @@ -67,9 +68,21 @@ private async Task LoadData()

if (!string.IsNullOrEmpty(confirmation.Icon))
{
PictureBox pictureBox = new PictureBox() { Width = 60, Height = 60, Location = new Point(20, 20), SizeMode = PictureBoxSizeMode.Zoom };
pictureBox.Load(confirmation.Icon);
panel.Controls.Add(pictureBox);
PictureBox pictureBox = new PictureBox() { Width = 60, Height = 60, Location = new Point(20, 20), SizeMode = PictureBoxSizeMode.Zoom };

try
{
pictureBox.Load(confirmation.Icon);
}
catch(WebException)
{
// loading images from cdn using https broken in windows 7
// so let's use http instead https
string httpIcon = confirmation.Icon.Replace("https://", "http://");
pictureBox.Load(httpIcon);
}

panel.Controls.Add(pictureBox);
}

Label nameLabel = new Label()
Expand Down

0 comments on commit 4ca24d0

Please sign in to comment.