I have a hardware device with a small web server built into it. I do not control how the web server works or is programmed. It sends back a small XML file when you request it, the problem is that the server does NOT send back any header information.
Here is the ways I have attempted to connect to it. (I have even placed the device on its own static ip for you to test - included in the code snippet below).
Dim request As HttpWebRequest = HttpWebRequest.Create("http://96.39.92.3:81/state.xml")
request.Method = WebRequestMethods.Http.Get
' I Have added the following two lines to test, they do not help alone or together.
' I also added: <httpWebRequest useUnsafeHeaderParsing="true" /> to the config file.
request.ProtocolVersion = HttpVersion.Version10
request.ServicePoint.Expect100Continue = False
Dim oResponse As HttpWebResponse = request.GetResponse()
Dim reader As New StreamReader(oResponse.GetResponseStream())
Dim tmp As String = reader.ReadToEnd()
oResponse.Close()
If oResponse.StatusCode = "200" Then
MsgBox(tmp)
Else
Throw New ApplicationException("Error Occurred, Code: " & oResponse.StatusCode)
End If
I have also tried using a XmlTextReader with the same results.
Thanks for your help.
EDIT: Fiddler Response (Used Chrome to Request Document)
RAW REQUEST:
GET http://96.39.92.3:81/state.xml HTTP/1.1
Host: 96.39.92.3:81
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
RAW RESPONSE:
HTTP/1.0 200 This buggy server did not return headers
<?xml version="1.0" encoding="utf-8"?>
<datavalues>
<relaystate>1</relaystate>
<inputstate>0</inputstate>
<rebootstate>0</rebootstate>
<totalreboots>0</totalreboots>
</datavalues>
With Fiddler open, the httpwebrequest above works. Fiddler must add the headers back in before it gets to the .net application.
Edit 2: Adjusted Header values for request. This makes icepickles tcpclient work for me. The cookie value was required.
WriteTextToStream(stream, tcpClient, "GET /state.xml?relayState=1 HTTP/1.0" & ControlChars.CrLf & _
" Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" & ControlChars.CrLf & _
"Referer: " & ControlChars.CrLf & "Accept -Language : en -gb" & ControlChars.CrLf & _
"Content-Type: application/x-www-form-urlencoded" & ControlChars.CrLf & _
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6" & ControlChars.CrLf & _
"Host: 192.168.1.232" & ControlChars.CrLf & _
"Connection: Keep -Alive" & ControlChars.CrLf & ControlChars.CrLf & _
"Cookie:")
I restarted this post, based on the comments, the original reply should still be in the edit chain, in case somebody needs/wants it.
The idea is, instead of using the HttpWebRequest, that has all the extra checks build in, you just connect with your server using a TcpClient or since your extra question, try to connect with the server using the basic Socket, and request your data manually (and ignore the fact that you don't get headers, just the file in the response)
The following thing works from my computer to request the url, i'm sure it would also work with the previous TcpClient (see edit), but in this case, i just used the System.Net.Sockets.Socket instead.
The error in the previous version was actually that i used C# \r\n instead of VB.net VbCrLf in a string literal, my mistake ;)
Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Module Module1
Sub WriteTextToStream(ByRef stream As NetworkStream, text As String)
Dim buffer As Byte() = System.Text.Encoding.ASCII.GetBytes(text)
stream.Write(buffer, 0, buffer.Length)
End Sub
Function CreateHeaders(ParamArray headers() As KeyValuePair(Of String, String)) As String
Dim message As New StringBuilder()
If headers IsNot Nothing Then
For Each kvp In headers
message.AppendLine(kvp.Key & ": " & kvp.Value)
Next
End If
Return message.ToString()
End Function
Function DownloadSocketClient(server As String, port As Integer, path As String, host As String) As String
Dim hostEntry = Dns.GetHostEntry(server)
Dim ipEndPoint As New IPEndPoint(hostEntry.AddressList(0), port)
Dim textResponse As String = String.Empty
Using tcpClient As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
tcpClient.Connect(ipEndPoint)
Dim networkHost As String = host & ":" & port
Dim headerMessage As String = CreateHeaders(
New KeyValuePair(Of String, String)("Host", networkHost)
)
' autoconnect
Using stream As NetworkStream = New NetworkStream(tcpClient)
' send request to server
WriteTextToStream(stream, String.Format("GET /{1} HTTP/1.1{3}{2}{3}", networkHost, path, headerMessage, Environment.NewLine))
'wait till data is available
While Not stream.DataAvailable
System.Threading.Thread.Sleep(1)
End While
' get the response from the networkstream
Dim requestSize As Integer = tcpClient.ReceiveBufferSize
Dim result As Integer
Dim readRequest(requestSize) As Byte
While stream.DataAvailable
result = stream.Read(readRequest, 0, requestSize)
textResponse &= System.Text.Encoding.UTF8.GetString(readRequest, 0, result)
End While
End Using
End Using
Return textResponse
End Function
Sub Main()
Dim fileContent As String = DownloadSocketClient("stackoverflow.server.textconnects.com", 81, "state.xml", "stackoverflow.server.textconnects.com")
Console.WriteLine("Received file: " & vbCrLf & fileContent)
Console.ReadLine()
End Sub
End Module
Related
I've been given some data to perform a call to ping a server that is contained within our work network. This call must happen from within the vb.net application I've built, but I'm really struggling to even get started on this one. I've tried creating a WebRequest, but I'm not even sure that's correct.
Here's what I have ("xxx" replacing sensitive parts):
POST /xxx/XmlService HTTP/1.1
Host: xxx001 (this is just the server name)
Content-Type: text/xml
Cache-Control: no-cache
Postman-Token: xxx (long token)
<?xml version="1.0" ?>
<xxx version="1.0">
<Request
Object="System"
Action="Ping">
</Request>
</xxx>
And I'm expecting an XML response back.
Can someone at least point me in the right direction? Thank you immensely!
I finally got it to connect. Here's how for those who follow (using same replace "xxx" strings as in OP):
Dim uriTest As Uri
uriTest = New Uri("http://xxx001/xxx/XmlService")
Dim requestStr As String
requestStr = Strings.Trim("POST /xxx/XmlService HTTP/1.1" & Environment.NewLine &
"Host: xxx001" & Environment.NewLine &
"Content-Type: text/xml" & Environment.NewLine &
"Cache-Control: no-cache" & Environment.NewLine &
"Postman-Token: 6672bfe9-6d44-4770-869d-4f08c24ab143" & Environment.NewLine & Environment.NewLine &
"<?xml version=""1.0"" ?>" & Environment.NewLine &
"<xxx version=""1.0"">" & Environment.NewLine &
"<Request" & Environment.NewLine &
"Object=""System""" & Environment.NewLine &
"Action=""Ping"">" & Environment.NewLine &
"</Request>" & Environment.NewLine &
"</xxx>")
Dim req As HttpWebRequest, webreq As WebRequest
webreq = WebRequest.Create(uriTest)
req = CType(webreq, HttpWebRequest)
req.Method = "POST"
Dim dataStream As Stream = req.GetRequestStream()
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(requestStr)
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim response As WebResponse = req.GetResponse()
Console.WriteLine(CType(response, HttpWebResponse).StatusDescription)
dataStream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
Console.WriteLine(responseFromServer)
reader.Close()
dataStream.Close()
response.Close()
i have a vb.net console application that logged into a website (POST form) by using Webclient:
Dim responsebytes = myWebClient.UploadValues("https:!!xxx.com/mysession/create", "POST", myNameValueCollection)
Last friday this suddenly stopped working, it worked without a problem for about 2-3 years. With Fiddler I got a HTTP 504 error but without Fiddler I got the error message:
The underlying connection was closed: The connection was closed unexpectedly.
I assume that something on the server-side has changed, but I have no influence on that. It's a commercial website, where I want to login automatically on my account to fetch some data.
As Fiddler can't help me much further I decided to built a basic HttpWebRequest example to rule out it was caused by the WebClient.
The example does:
navigate to the homepage of the company and read out an securityToken (this goes ok!)
post the securityToken + username + password to get logged in.
Public Class Form1
Const ConnectURL = "https:!!member.company.com/homepage/index"
Const LoginURL = "https:!!member.company.com/account/logn"
Private Function RegularPage(ByVal URL As String, ByVal CookieJar As CookieContainer) As String
Dim reader As StreamReader
Dim Request As HttpWebRequest = HttpWebRequest.Create(URL)
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
Request.AllowAutoRedirect = False
Request.CookieContainer = CookieJar
Dim Response As HttpWebResponse = Request.GetResponse()
reader = New StreamReader(Response.GetResponseStream())
Return reader.ReadToEnd()
reader.Close()
Response.Close()
End Function
Private Function LogonPage(ByVal URL As String, ByRef CookieJar As CookieContainer, ByVal PostData As String) As String
Dim reader As StreamReader
Dim Request As HttpWebRequest = HttpWebRequest.Create(URL)
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
Request.CookieContainer = CookieJar
Request.AllowAutoRedirect = False
Request.ContentType = "application/x-www-form-urlencoded"
Request.Method = "POST"
Request.ContentLength = PostData.Length
Dim requestStream As Stream = Request.GetRequestStream()
Dim postBytes As Byte() = Encoding.ASCII.GetBytes(PostData)
requestStream.Write(postBytes, 0, postBytes.Length)
requestStream.Close()
Dim Response As HttpWebResponse = Request.GetResponse()
For Each tempCookie In Response.Cookies
CookieJar.Add(tempCookie)
Next
reader = New StreamReader(Response.GetResponseStream())
Return reader.ReadToEnd()
reader.Close()
Response.Close()
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim CookieJar As New CookieContainer
Dim PostData As String
Try
Dim homePage As String = (RegularPage(ConnectURL, CookieJar))
Dim securityToken = homePage.Substring(homePage.IndexOf("securityToken") + 22, 36) 'momenteel 36 characters lang
PostData = "securityToken=" + securityToken + "&accountId=123456789&password=mypassword"
MsgBox(PostData)
Dim accountPage As String = (LogonPage(LoginURL, CookieJar, PostData))
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
End Class
This line causes the connection to be closed:
Dim requestStream As Stream = Request.GetRequestStream()
Is it possible that this company doesnt like the automated login and somehow notices that a application is used for logging in? How can I debug this? Fiddler doesn't seem to work. Is my only option WireShark as this seems kind of difficult to me.
Also is it weird that the connection is already is closed before I do the Post?
Are there other languages I can program this "easily" to rule out it's VB.net / .NET problem?
Have you attempted to capture the request using something like your browser's networking tools?
The auth process may have changed. Could even be some name or post data changes.
I got this fixed by:
double checking all the headers to be sent when using a browser
made sure all those headers where sent by the VB.NET application.
Not sure which one did the trick, but just always make sure you replicate all the headers that the browser would sent!
i was inspired by Awesomium and im trying to use it as my client side app for my web application using vb.net . im trying to do an uploader module where our clinets can upload any files to our server . i used HttpWebRequest for uploading files which is working fine. but only problem is how to set the session created by Awesomium when i logged on to my web application to httpwebrequest . or is there any other way in awesomium itself to upload files to the server (ie php server ) .
Please apologies im not good in English.
below is the code im using for upload
Dim filepath As String = Path 'Path to file on local machine
Dim url As String = "http://xxxxx.com/uploadscanfile.php"
Dim boundary As String = IO.Path.GetRandomFileName
ImageRandomName.Add(IO.Path.GetFileName(filepath))
Dim header As New System.Text.StringBuilder()
header.AppendLine("--" & boundary)
header.Append("Content-Disposition: form-data; name=""file"";")
header.AppendFormat("filename=""{0}""", IO.Path.GetFileName(filepath))
header.AppendLine()
header.AppendLine("Content-Type: application/octet-stream")
header.AppendLine()
Dim headerbytes() As Byte = System.Text.Encoding.UTF8.GetBytes(header.ToString)
Dim endboundarybytes() As Byte = System.Text.Encoding.ASCII.GetBytes(vbNewLine & "--" & boundary & "--" & vbNewLine)
Dim req As Net.HttpWebRequest = Net.HttpWebRequest.Create(url)
req.ContentType = "multipart/form-data; boundary=" & boundary
req.ContentLength = headerbytes.Length + New IO.FileInfo(filepath).Length + endboundarybytes.Length
req.AllowAutoRedirect = True
req.Timeout = -1
req.KeepAlive = True
req.AllowWriteStreamBuffering = False
req.Method = "POST"
Dim s As IO.Stream = req.GetRequestStream
s.Write(headerbytes, 0, headerbytes.Length)
Dim filebytes() As Byte = My.Computer.FileSystem.ReadAllBytes(filepath)
s.Write(filebytes, 0, filebytes.Length)
s.Write(endboundarybytes, 0, endboundarybytes.Length)
s.Close()
Typically, session info is stored in the cookies. So, you will first need to send the log in data (and receive a reply). Also, when receiving the reply, you need to set a CookieContainer in the CookieContainer property and you will reuse it later. Only then, you can send the form data and upload the file, but make sure to set the CookieContainer to the CookieContainer that has the log in cookies when uploading.
A good way to see all the request/responses that go through to/from the server when loging in, I suggest you use Fiddler it is a very useful tool that monitors all the requests that you make. Note the headers, data that gets send and anything else that you may find useful.
More code:
Here is the part that logs you in: The post string that you send needs to contain the username and password. (and any other info that may be required).
Dim CookieJar As New CookieContainer() 'The CookieContainer that will keep all the cookies.
'DO NOT CLEAR THIS BETWEEN REQUESTS! ONLY CLEAR TO "Log Out".
Dim req As HttpWebRequest = HttpWebRequest.Create("<login URL goes here>")
req.Method = "POST"
req.Accept = "text/html, application/xhtml+xml, */*" 'This may be a bit different in your case. Refer to what Fiddler will say.
req.CookieContainer = CookieJar
req.ContentLength = post_str.Length
req.ContentType = "application/x-www-form-urlencoded" 'Also, any useragent will do.
req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"
req.Headers.Add("Accept-Language", "en-US,en;q=0.7,ru;q=0.3")
req.Headers.Add("Accept-Encoding", "gzip, deflate")
req.Headers.Add("DNT", "1") 'Make sure to add all headers that you found using Fiddler!
req.Headers.Add("Pragma", "no-cache")
Dim RequestWriter As New IO.StreamWriter(req.GetRequestStream())
RequestWriter.Write(post_str) 'Write the post string that contains the log in, password, etc.
RequestWriter.Close()
RequestWriter.Dispose()
Dim ResponceReader As New IO.StreamReader(req.GetResponse().GetResponseStream())
Dim ResponceData As String = ResponceReader.ReadToEnd()
ResponceReader.Close()
ResponceReader.Dispose()
req.GetResponse.Close()
'In the long run, you can check the ResponceData to verify that the log in was successful.
Here is where the CookieJar gets used to sent a request:
post_str = "" 'What needs to be sent goes in this variable.
req = HttpWebRequest.Create("<page to send request to goes here>")
req.Method = "POST"
req.Accept = "text/html, application/xhtml+xml, */*" 'May be different in your case
req.CookieContainer = CookieJar 'Please note: this HAS to be the same CookieJar as you used to login.
req.ContentLength = post_str.Length
req.ContentType = "application/x-www-form-urlencoded"
req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"
req.Headers.Add("Accept-Language", "en-US,en;q=0.7,ru;q=0.3")
req.Headers.Add("Accept-Encoding", "gzip, deflate")
req.Headers.Add("DNT", "1") 'Add all headers here.
req.Headers.Add("Pragma", "no-cache")
RequestWriter = New IO.StreamWriter(req.GetRequestStream())
RequestWriter.Write(post_str)
RequestWriter.Close()
RequestWriter.Dispose()
ResponceReader = New IO.StreamReader(req.GetResponse().GetResponseStream())
ResponceData = ResponceReader.ReadToEnd()
ResponceReader.Close()
ResponceReader.Dispose()
req.GetResponse.Close()
'You may want to read the ResponceData.
Hope this helps.
I have here a working HTTP request using SOCKETS but I do not know how to send POST requests.
Here is my code:
Dim hostName As String
Dim hostPort As Integer
Dim response As Integer
Dim iphe As IPHostEntry = Dns.GetHostEntry("www.yellowpages.com")
hostName = iphe.AddressList(0).ToString()
hostPort = 80
response = 0
Dim host As IPAddress = IPAddress.Parse(hostName)
Dim hostep As New IPEndPoint(host, hostPort)
Dim sock As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
sock.Connect(hostep)
Dim request = "GET /nationwide/mip/choice-hotels-international-462092189/send_email?lid=161004592 HTTP/1.1" & vbCr & vbLf &
"Host: 208.93.105.105" & vbCr & vbLf &
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36" & vbCr & vbLf &
"Connection: keep-alive" & vbCr & vbLf &
"Content-Type: application/x-www-form-urlencoded" & vbCr & vbLf &
"Content-Length: 0" & vbCr & vbLf & vbCr & vbLf
response = sock.Send(Encoding.UTF8.GetBytes(request))
response = sock.Send(Encoding.UTF8.GetBytes(vbCr & vbLf))
sock.Close()
I wanted to fill-up this webform i have mentioned in my code with these data:
email%5Bto_address%5D=test#mail.com&email%5Bfrom_name%5D=Test Name&email%5Bfrom_address%5D=test#mail.com&email%5Bnote%5D=Hello
How do I do it? I have successfully done this using HttpWebRequest using the code below:
Dim cweb As String = "http://www.yellowpages.com/novato-ca/mip/creative-memories-consultant-senior-director-461725587/send_email?lid=171673036"
Dim POST As String = "&email%5Bto_address%5D=recipient#email.com&email%5Bfrom_name%5D=Test Name&email%5Bfrom_address%5D=sender#mail.com&email%5Bnote%5D=Hello There"
Dim request As HttpWebRequest
Dim response As HttpWebResponse
request = CType(WebRequest.Create(cweb), HttpWebRequest)
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"
request.AllowAutoRedirect = True
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = POST.Length
request.Method = "POST"
request.KeepAlive = True
Dim requestStream As Stream = request.GetRequestStream()
Dim postBytes As Byte() = Encoding.ASCII.GetBytes(POST)
requestStream.Write(postBytes, 0, postBytes.Length)
requestStream.Close()
response = CType(request.GetResponse(), HttpWebResponse)
response.Close()
But I wanted to recreate this concept by the use of SOCKETS.
If you can send a GET request using Sockets then you can certainly send a POST request.
You have to format it properly though. You can check the RFC for the whole HTTP specs.
Sample of a POST:
Dim request = "POST /nationwide/mip/choice-hotels-international-462092189/send_email?lid=161004592 HTTP/1.1" & Environment.Newline &
"Host: 208.93.105.105" & Environment.Newline &
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36" & Environment.Newline &
"Connection: keep-alive" & Environment.Newline &
"Content-Type: application/x-www-form-urlencoded" & Environment.Newline &
"Content-Length: 22" & Environment.Newline & Environment.Newline &
"this%20is%20the%20data"
Okay so I was going to post this on the last 3 errors I got, but I fixed those all(thankfully). I no longer get any kind of cookie blocked message, however now I get a Error logging in whether I'm putting in the correct password or an invalid one. I think its either
A. a cookie storage error.
B. or a problem with redirection.
Imports System.Text
Imports System.Net
Imports System.IO
Public Class Form1
Dim logincookie As CookieContainer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim postData As String = "log=" & TextBox1.Text & "&pwd=" & TextBox2.Text & "wp- submit=Log+In&redirect_to=""http://csvlife.com/wp-admin/" & "&wordpress_test_cookie=1"
Dim tempcookies As New CookieContainer()
Dim encoding As New UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://csvlife.com/wp-login.php"), HttpWebRequest)
postreq.Method = "POST"
postreq.KeepAlive = True
postreq.AllowAutoRedirect = True
postreq.CookieContainer = tempcookies
postreq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre"
postreq.ContentType = "application/x-www-form-urlencoded"
postreq.Referer = "http://csvlife.com/wp-login.php"
postreq.ContentLength = byteData.Length
Dim postreqstream As Stream = postreq.GetRequestStream()
postreqstream.Write(byteData, 0, byteData.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
tempcookies.Add(postresponse.Cookies)
logincookie = tempcookies
Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
Dim thepage As String = postreqreader.ReadToEnd
If thepage.Contains("ERROR") Then
MsgBox("Error logging in!")
Else
MsgBox("Lets Start Blogging!")
End If
End Sub
End Class
I have my fiddler open and I've logged into the page and noticed that when I login regularly from by regular browser
fiddler will show this:
then the results come in and it looks like this:
Clarification: The pictures above is what the web traffic info looks like when I login from any basic browser on my computer
Here is what it looks like what I login from the program:
Always an error.
And the request number is just 200 no 302 before or after.
However when I try through my program the req number always remains 200 which is post. Its like it never gets to redirect and I don't know why. Notes: This is my website and this not for any kind of malware or whatever. Its just for blog automation. If there was anything else I could find on this matter I would. At this point I have no other option. Thank you kindly for your help and consideration.
In line 9:
Dim postData As String = "log=" & TextBox1.Text & "&pwd=" & TextBox2.Text & "wp- submit=Log+In&redirect_to=""http://csvlife.com/wp-admin/" & "&wordpress_test_cookie=1"
The parameters to be sent with the post need to be separated with an ampersand, as written the password parameter has "wp- submit=Log+In&redirect_to=http://csvlife.com/wp-admin/" appended to it.
Assuming wp is a parameter:
Dim postData As String = "log=" & TextBox1.Text & "&pwd=" & TextBox2.Text & "&wp- submit=Log+In&redirect_to=""http://csvlife.com/wp-admin/" & "&wordpress_test_cookie=1"