private void OpenUrl(string url)
{
try
{
Process.Start(url);
}
catch
{
// hack because of this: https://github.com/dotnet/corefx/issues/10361
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
url = url.Replace("&", "^&");
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url);
}
else
{
throw;
}
}
}
1) Базовые знания Assembly
2) изучения каких-либо детектив (winapi, или ещё чего)
3) ну и т.д
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
var dict = new Dictionary<string, List<string>> {
["a b"] = new List { "c", "b" },
["b"] = new List { "a", "e" },
["d c e"] = new List { "d" }
};
Console.WriteLine(dict["b"][0]);
Console.WriteLine(dict["a b"][1]);
Console.WriteLine(dict["a b"][0]);
Console.WriteLine(dict["d c e"][0]);
Console.WriteLine(dict["b"][1]);
Сталкиваюсь впервые, вопрос, как производит логирование, нужно что для всех этих библиотек-проектов подключать NLOG?
public static QueryableExtensions {
public static IQueryable<T> TakePaged<T>(this IQueryable<T> query, int take, int skip) =>
query.Take(take).Skip(skip);
}
Но я не пойму куда его запихнуть) Если впихнуть его в этот класс, где находится работа с entity, то ошибку получаю, что расширяющие методы должны быть в non-generic-классах...
Result.ToString();
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
var formData = new Dictionary<string, string>
{
{"CaseNumbers", ""},
{"Count", "25"},
{"Courts", ""},
{"DateFrom", null},
{"DateTo", null},
{"Judges", ""},
{"Page", "1"},
{"Sides", ""},
{"WithVKSInstances", "false"},
};
using var client = new HttpClient();
var uri = new Uri("https://kad.arbitr.ru/");
var content = new FormUrlEncodedContent(formData);
var response = await client.PostAsync(uri, content);
var str = await response.Content.ReadAsStringAsync();
System.IO.File.WriteAllText("./result.html", str);