WebClient POST not passing RRS feed

  • Question

  • Good afternoon,

    Ive written to below code which is a simple proof of concept to see if I can get it working. What Im trying to do is post some values to a PHP form. I know know that the php is called after troubleshooting with this forum, and it works fine calling it, but it doesnt seem to pass the strID and valBlob fileds through as a POST.

    The data is being created as the variable d, and passed as the data argument in the uploadstring method.

    I have put a little catch in the PHP page to look at all the data, and it doesnt see any values in the headers.

    Any ideas what Im doing wrong to prevent me from being able to post values to a webpage?

    Ive attached my simple code below, in the hope someone can tell me the issue.

    Thank you in advance.



    Imports System.IO

    Partial Public Class MainPage

    Inherits UserControl

    Public Sub New()


    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click

    Dim encoding As New System.Text.UTF8Encoding

    Dim wc As New System.Net.WebClient()

    Dim d As String = "strID=" & "43234" & "&valBlob=" & "234234"

    AddHandler wc.UploadStringCompleted, AddressOf wcCompleted

    AddHandler wc.UploadProgressChanged, AddressOf wcProgressChanged

    wc.UploadStringAsync(New Uri("http://localhost/upload.php"), "POST", d)

    End Sub

    Private Sub wcCompleted(ByVal sender As Object, ByVal e As UploadStringCompletedEventArgs)

    TextBlock1.Text = Now() & "-Completed"

    End Sub

    Private Sub wcProgressChanged(ByVal sender As Object, ByVal e As UploadProgressChangedEventArgs)

    TextBlock1.Text = Now() & e.UserState & ", " & e.BytesSent & "/" & e.TotalBytesToSend & "-" & e.ProgressPercentage & "%" & vbCrLf

    End Sub

    End Class

    Wednesday, February 23, 2011 8:21 AM