sking:
You're code doesn't work. DOes anyone know how to get the variables form the POST? Please post code in VB and NOT c#
Hi,
It seems that the string in your first post is a querystring instead of form post. You can easily have this test.
1. Create a new web page named test.aspx
2. Write these code into the Page_Load event of the test.aspx page.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim amount = Request.Form("mc_gross")
Dim currency = Request.Form("currency")
Dim pmtdate = Request.Form("payment_date")
Dim status = Request.Form("payment_status")
Dim charset = Request.Form("charset")
Dim first_name = Request.Form("first_name")
End Sub
3. Use this URL to visit test.aspx: add a question mark after .aspx extension and append the string to the question mark.
test.aspx?mc_gross=0.05&protection_eligibility=Ineligible&payer_id=UEWAFF732VL&tax=0.00&payment_date=22%3A36%3A55+Jul+21%2C+2009+PDT&payment_status=Completed&charset=windows-1252&first_name=Scot
Of course, we can also retrieve the data from this string via this example if it is a querystring.
Dim input As String = "mc_gross=0.05&protection_eligibility=Ineligible&payer_id=UEWAFF732VL&tax=0.00&payment_date=22%3A36%3A55+Jul+21%2C+2009+PDT&payment_status=Completed&charset=windows-1252&first_name=Scot"
input = Server.UrlDecode(input)
Dim hash As New Hashtable
Dim arr() As String = input.Split("&")
For Each pair As String In arr
Dim key, value As String
key = pair.Substring(0, pair.IndexOf("="))
value = pair.Substring(pair.IndexOf("=") + 1)
hash.Add(key, value)
Next
Best Regards,
Shengqing Yang
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread : )