WebProxy proxy = new WebProxy();
proxy.Address = new Uri("mywebproxyserver.com");
proxy.Credentials = new NetworkCredential("usernameHere", "pa****rdHere"); //These can be replaced by user input
proxy.UseDefaultCredentials = false;
proxy.BypassProxyOnLocal = false; //still use the proxy for local addresses
WebClient client = new WebClient();
client.Proxy = proxy;
string doc = client.DownloadString("http://www.google.com/");
Я попробовал запустить Hyper-V в Windows 10 и это оказалось очень неудобным, а некоторые вещи вообще невозможны. Например, если у меня разрешение монитора 1920x1080, то в окне диспетчера Hyper-V размер экрана виртуальной машины тоже будет 1920x1080 без возможности его уменьшить, также отсутствует возможность подключаться к экрану виртуальной машины по VNC, как это можно в VMware Workstation, также отсутствуют другие возможности, которые есть VMware Workstation, KVM и других гипервизорах, например возможность пробросить флешку в ВМ как физическое устройство или сделать так, чтобы ВМ создавалась скриптом автоматически с заранее описанной конфигурацией. Вроде слышал, что для профессиональных задач таких как последняя есть System Center Virtual Machine Manager, но оно опять же работает только на сервере.
using System;
using System.Linq;
namespace ConsoleApp99
{
internal class Program
{
private static void Main()
{
const int size = 5;
var data = new double[size];
var i = 0;
Console.WriteLine("Enter float or double");
do
{
var parsed = double.TryParse(Console.ReadLine(), out var dp);
if (!parsed) continue;
data[i] = dp;
i++;
} while (i < size);
var x = data.Min();
Console.WriteLine($"min: {x}");
var y = data.Max();
Console.WriteLine($"max: {y}");
Console.WriteLine($"sum x + y: {x + y}");
}
}
}
server {
server_name test.com;
ssl_certificate "/var/www/httpd-cert/www-root/test_com_le2.crtca";
ssl_certificate_key "/var/www/httpd-cert/www-root/test_com_le2.key";
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/test_com/*.conf;
access_log /var/www/httpd-logs/test_com.access.log;
error_log /var/www/httpd-logs/test_com.error.log notice;
ssi on;
set $root_path /var/www/www-root/data/www/test_com/public;
root $root_path;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi| zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
# тут хранится статика SPA
location /mks/ {
root /var/www/www-root/data/www/test_com;
}
# Прокси для api
location /api/mapinfo/ {
proxy_pass http://localhost:5010/api/mapinfo;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
listen 123.123.123.123:443 ssl;
}
npm run serve
public async getInfo(): Promise<Info> {
const data = await axios.get(this.API_URL);
return data.data;
}