mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
fixed #1523: Handle proxy issues
This commit is contained in:
parent
952320fc9f
commit
5f72b2adab
1 changed files with 11 additions and 4 deletions
|
@ -66,11 +66,18 @@ public bool IsValidProxy()
|
|||
|
||||
public IWebProxy GetWebProxy()
|
||||
{
|
||||
if (IsValidProxy())
|
||||
try
|
||||
{
|
||||
NetworkCredential credentials = new NetworkCredential(Username, Password);
|
||||
string address = string.Format("{0}:{1}", Host, Port);
|
||||
return new WebProxy(address, true, null, credentials);
|
||||
if (IsValidProxy())
|
||||
{
|
||||
NetworkCredential credentials = new NetworkCredential(Username, Password);
|
||||
string address = string.Format("{0}:{1}", Host, Port);
|
||||
return new WebProxy(address, true, null, credentials);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugHelper.WriteException(e, "GetWebProxy failed");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue