Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > .NET Frameworks (точка нет фреймворки) > Общие вопросы .NET
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 03.02.2012, 13:48   #1
Cpluser
Форумчанин
 
Аватар для Cpluser
 
Регистрация: 16.02.2009
Сообщений: 555
По умолчанию post multipart/form-data

Вот мой код не пост возрашает пусто
Код:
 StringBuilder sb = new StringBuilder();
            string boundary = DateTime.Now.Ticks.ToString();
            string newLine = "\r\n";
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"retpath\"" + newLine + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("http://my.yandex.ru/" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"journal-type\"" + newLine + newLine);
            sb.Append("yaru" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"head-background\"" + newLine + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"main-color\"" + newLine + newLine);
            sb.Append("#f1f1f1" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"second-color\"" + newLine + newLine);
            sb.Append("#e3e3e3" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"background-color\"" + newLine + newLine);
            sb.Append("#f9f9f9" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"text-color\"" + newLine + newLine);
            sb.Append("#000000" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"header-color\"" + newLine + newLine);
            sb.Append("#000000" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"subheader-color\"" + newLine + newLine);
            sb.Append("#000000" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"birth_day\"" + newLine + newLine);
            sb.Append("00" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"birth_month\"" + newLine + newLine);
            sb.Append("00" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"birth_year\"" + newLine + newLine);
            sb.Append("0000" + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"title\"" + newLine + newLine);
            sb.Append(name + " " + sur + newLine);
            sb.Append("-----------------------------" + boundary + newLine);
            sb.Append("Content-Disposition: form-data; name=\"sex\"" + newLine + newLine);
            sb.Append("man" + newLine);
            sb.Append("Content-Disposition: form-data; name=\"city\"" + newLine + newLine + newLine);
            sb.Append("-----------------------------" + boundary + "--");

            string postData1 = sb.ToString();
            httpClient.ContentType = "multipart/form-data";
            post = httpClient.Post("http://my.ya.ru/registration_simple_do_options.xml", postData1);
Cpluser вне форума Ответить с цитированием
Старый 06.02.2012, 09:30   #2
Руслантус
Наркоман самоучка
Форумчанин
 
Аватар для Руслантус
 
Регистрация: 22.07.2007
Сообщений: 276
По умолчанию

О Господи. Вот вам в помощь http://blog.epicsoft.ru/?p=8 Там найдёте и про Multipart/form-data
#include <мозг.h>
Руслантус вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Data Form Wizard sir.andrey Помощь студентам 2 02.11.2011 05:34
С# отправка multipart/form-data запроса xata1988 ASP.NET 0 12.10.2011 22:47
C# multipart/form-data Pedro Работа с сетью в Delphi 1 18.10.2010 19:42
Пост запрос в кодировке 'multipart/form-data' bmp152 Работа с сетью в Delphi 1 21.01.2010 02:58
data form wizard чижик-пыжик Общие вопросы .NET 0 18.12.2009 23:42