I'm using Live HTTP Headers, I post something manually (create new topic), then I look into it and I copy the string of the POST method... Then I copy this string to my code and it works fine, I can login and post...
But after a certain time I can't do it anymore, I think it's because the string must change, specially in the parameters "lastclick", "creation_time" and "form_token"... This is an example of the string I'm talking about:
subject=" & TextBoxSubject.Text & "&addbbcode20=100&message=" & TextBoxMessage.Text & "&lastclick=1361985462&post=Submit&attach_sig=on&creation_time=1361985462&form_token=229b24d265f1058324716672f0f9f7c126b2b58e&poll_title=&poll_option_text=&poll_max_options=1&poll_length=0
As you can see, those 3 parameters have those long numbers, which lastclick is the same than creation_time...
I'd like to know how I can get those numbers and generate them programatically so I can post today, and again in one week from now for example and so on.
Here is another part of my code, if you think there's an easier way or something let me know so I can try to avoid this situation:
Dim postpost As String = "" 'here goes the same string as above Dim encoding As New UTF8Encoding Dim byteData As Byte() = encoding.GetBytes(postpost) Dim request As HttpWebRequest = DirectCast(WebRequest.Create(here I put the link of the "new topic" button), HttpWebRequest) request.Method = "POST" request.ContentType = "application/x-www-form-urlencoded" request.Referer = ''here the link where I came from request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0" request.CookieContainer = logincookie 'this cookie has been saved at the beginning after the successfull login'' request.ContentLength = byteData.Length Dim postreqstream As Stream = request.GetRequestStream() postreqstream.Write(byteData, 0, byteData.Length) postreqstream.Close() Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse) Dim reader As New StreamReader(response.GetResponseStream) Dim thepost As String = reader.ReadToEnd RichTextBox1.Text = thepost
Thanks alot! Sorry for my english!