Отправка сообщения ВКонтакте программно - Visual Basic .NET
Формулировка задачи:
Доброго времени суток! Люди подскажите как программно отправить сообщение Вконтакте ...
С начало я залогинелся... после чего получил Hash с http://vk.com/feed затем поймал пакет с сообщением "al_mail.php"
затем вставляем нужное сообщение и Hash
act=a_send&al=1&chas=7a523e4027dq47ee0b&from=box&media=&message=qwerty&title=&to_ids=10112
После отправки , сообщение не доходит .. Приходит ответ примерно такой : <!--14232<!><!>0<!>6556<!>3<!>a03b0c196113cf2bc3
Подскажите в чём дело..
Заранее благодарен
Решение задачи: «Отправка сообщения ВКонтакте программно»
textual
Листинг программы
Dim postdata As String = "Message=qwerty&act=post&al=1&from=&hash=fcc0f2caf8fpfb0638&reply_to=-92779082_48359&reply_to_msg=&reply_to_user=0&start_id=48380&type=own" Dim tempCookies As New CookieContainer Dim encoding As New UTF8Encoding Dim bytedata As Byte() = encoding.GetBytes(postdata) Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("http://vk.com/al_wall.php"), HttpWebRequest) postReq.Method = "POST" postReq.KeepAlive = True postReq.CookieContainer = tempCookies postReq.ContentType = "application/x-www-form-urlencoded" postReq.UserAgent = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12" ' postReq.Referer = "Referer: " postReq.ContentLength = bytedata.Length Dim postreqststream As Stream = postReq.GetRequestStream() postreqststream.Write(bytedata, 0, bytedata.Length) postreqststream.Close() Dim postresponse As HttpWebResponse postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse) _loginCookie = tempCookies Dim postreqreader As New StreamReader(postresponse.GetResponseStream, System.Text.Encoding.Default) Dim thepage As String = postreqreader.ReadToEnd() postresponse.Close() postreqreader.Close() postreqststream.Close() RichTextBox1.Text = thepage
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д