Core在类中注入
private readonly IHttpClientFactory _iHttpClientFactory;
public static NetHelper Get = new NetHelper();
public NetHelper()
{
var serviceCollection = new ServiceCollection();
serviceCollection.AddHttpClient();
var service = serviceCollection.BuildServiceProvider();
_iHttpClientFactory = service.GetService<IHttpClientFactory>();
}