Написал сниппет для проверки валидности почты mail.ru
В VS все прекрасно работает,а в сниппете нет,почему?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://auth.mail.ru/cgi-bin/auth?from=splash");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
string data = "from=splash&Domain=mail.ru&Login=artemkxk1983%40mail.ru&Password=Z4PtEz5XU&new_auth_form=1&FromAccount=1&saveauth=1";
byte[] b = Encoding.UTF8.GetBytes(data);
request.ContentLength = b.Length;
request.GetRequestStream().Write(b, 0, b.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode.ToString() == "OK")
{
Stream rs = response.GetResponseStream();
StreamReader read = new StreamReader(rs, Encoding.UTF;
string content = read.ReadToEnd();
read.Close();
if (content.Contains("mpop"))
{
return true;
}
else
{
return false;
}
}
return false;
В VS все прекрасно работает,а в сниппете нет,почему?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://auth.mail.ru/cgi-bin/auth?from=splash");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
string data = "from=splash&Domain=mail.ru&Login=artemkxk1983%40mail.ru&Password=Z4PtEz5XU&new_auth_form=1&FromAccount=1&saveauth=1";
byte[] b = Encoding.UTF8.GetBytes(data);
request.ContentLength = b.Length;
request.GetRequestStream().Write(b, 0, b.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode.ToString() == "OK")
{
Stream rs = response.GetResponseStream();
StreamReader read = new StreamReader(rs, Encoding.UTF;
string content = read.ReadToEnd();
read.Close();
if (content.Contains("mpop"))
{
return true;
}
else
{
return false;
}
}
return false;