:
Код: Выделить всё
WebClient webClient = new WebClient();
webClient.Encoding = Encoding.UTF8;
string str2 = webClient.DownloadString(url);
if (Program.proxies.Count > 0)
{
string Address = Program.proxies[new Random().Next(0, Program.proxies.Count)];
string[] strArray = Address.Split(':');
if (strArray.Length > 2)
webClient.Proxy = (IWebProxy)new WebProxy(strArray[0] + ":" + strArray[1])
{
Credentials = (ICredentials)new NetworkCredential(strArray[2], strArray[3])
};
else
webClient.Proxy = (IWebProxy)new WebProxy(Address);
}
return str2.Replace("'", "'");
}
catch (Exception ex1)
{
try
{
using (StreamWriter streamWriter = System.IO.File.AppendText("log.txt"))
streamWriter.WriteLine("[" + DateTime.Now.ToString() + "] " + ex1.Message);
str1 = "";
}
catch (Exception ex2)
{
str1 = "";
}
}
Подробнее здесь: https://stackoverflow.com/questions/253 ... -be-parsed
Мобильная версия