29 lines
782 B
C#
29 lines
782 B
C#
using System.IO;
|
|
using System.Net;
|
|
|
|
namespace Pilz.Updating.Administration.GUI;
|
|
|
|
public static class General
|
|
{
|
|
private static string myAppPath = string.Empty;
|
|
public static UpdateProject CurProject { get; set; } = null;
|
|
|
|
public static string MyAppPath
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(myAppPath))
|
|
Path.GetDirectoryName(IO.Extensions.GetExecutablePath());
|
|
return myAppPath;
|
|
}
|
|
}
|
|
|
|
public static void SetProxyConfig()
|
|
{
|
|
if (CurProject.ProxyConfig.UseProxyAuth)
|
|
WebRequest.DefaultWebProxy.Credentials = new NetworkCredential(CurProject.ProxyConfig.Username, CurProject.ProxyConfig.Password);
|
|
else
|
|
WebRequest.DefaultWebProxy.Credentials = null;
|
|
}
|
|
}
|