for (int i = 0; i < 50; i++)
{
Thread thread = new Thread(MyMethod);
thread.IsBackground = true;
thread.Start();
}
private void MyMethod()
{
while (true)
{
}
}
Request.AllowWriteStreamBuffering = false;
List<Object>
в нём .Request.AllowWriteStreamBuffering = false;
private static string GetUrl(string id, string proxy , int port)
{
try
{
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://site.com/" + id);
Request.UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36";
Request.Method = "GET";
Request.KeepAlive = true;
Request.Timeout = 10000;
WebProxy myproxy = new WebProxy(proxy, port);
Request.Proxy = myproxy;
Request.AllowWriteStreamBuffering = false;
Request.AllowAutoRedirect = false;
Request.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
string _url;
using (HttpWebResponse response = (HttpWebResponse)Request.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
using (StreamReader sr = new StreamReader(stream, Encoding.UTF8))
{
_url = sr.ReadToEnd();
}
}
}
Request = null;
if (_url != null)
{
_url = Pars(_url, "url=", "\"", 0);
return _url;
}
else
{
return "error";
}
}
catch (Exception ex)
{
return "error";
}
}