I'm tyring to create a program that logins into my myspace and retrieves if i have new comments messages etc etc. I'm using the Winsock namespace as you can tell.Code:TCPClient = New System.Net.Sockets.TcpClient("myspace.com", 80) TCPClient.GetStream.BeginRead(readBuffer, 0, BYTES_TO_READ, AddressOf Read_Data, Nothing) Data_To_Send = "POST http://login.myspace.com/index.cfm?fuseaction=login.process " Data_To_Send = Data_To_Send & "&email=" & EmailTxt.Text & "&password=" & PasswordTxt.Text sw = New IO.StreamWriter(TCPClient.GetStream) sw.Write(Data_To_Send) sw.Flush()
When i send this data off to myspace i get:
Code:HTTP/1.1 400 Bad Request Content-Type: text/html Date: Thu, 10 Jan 2008 10:02:26 GMT Connection: close Content-Length: 20 <h1>Bad Request</h1>
Sent back to me. Now i know that this is because i'm not sending the correct headers and what not to the myspace server. I've tried catching the packets with a packet sniffer and HTTP Live Headers (With firefox) both returned gibberish. I've looked around for example codes for logging into myspace on these forums, but also, i get the Bad Request error returned to me.
So i'm hoping someone could help me out with finding out the correct things to send please.
Also, on another note:
Why does My.Settings.EmailText not save when the application is restarted? It will save when i try to read from it before i close the app, but it won't save once the app has been restarted. I also tried saving the text to the registry with the SaveSetting and GetSetting commands. It saves numbers, but they both don't save text. I find this very weird?Code:RememberMeChk.Checked = GetSetting("Myspace Checker", "Settings", "Chk Remember Me", 1) EmailTxt.Text = My.Settings.EmailText




Reply With Quote