Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix work on Windows 7 #920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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