Молчун
Зарегистрирован: 26 March 2008
Сообщения: 38
Примеры кода: 0
|
Помогите с кодировкой( |
18 July 2008 10:38 |
|
|
|
|
String URL = "[A]http://*****/EditCASB.do?login=mmm&password=mmm[/A]";
Uri clearstream = new Uri(URL);
Encoding encoding = Encoding.GetEncoding(1251);
HttpWebRequest httpGET = (HttpWebRequest)WebRequest.Create(clearstream);
// задаем параметры запроса
httpGET.CookieContainer = new CookieContainer();
// получение ответа
HttpWebResponse response = (HttpWebResponse)httpGET.GetResponse();
CookieCollection LogOffCollection = response.Cookies; // кукисы для всех запросов
URL = "[A]http://******/EditCASB.do?surname="+HttpUtility.UrlEncode("Малышев",encoding)+"&idSeries=1111[/A]";
httpGET = (HttpWebRequest)WebRequest.Create(clearstream);
// задаем параметры запроса
httpGET.CookieContainer = new CookieContainer();
httpGET.CookieContainer.Add(LogOffCollection);
response = (HttpWebResponse)httpGET.GetResponse();
StreamReader sReader = new StreamReader(response.GetResponseStream(), encoding);
string resp = sReader.ReadToEnd();
Label1.Text = resp;
response.Close();
Данное сообщение получено с сайта GotDotNet.RU
Последний раз редактировалось 18 July 2008 10:38
|
|