locked
How to pass encoded text to URL RRS feed

  • Question


  • (i'm using VB.NET. Is a Windows Form application)


    Hi

    I'm using this code to send encoded text to URL. This code is correct? Because if I send the same encoded text using PHP runs fine, but not in VB.NET

    baseurl = "http://myurl.com/mypage.php"
    
    
    client = NewWebClient
    client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)")
    sms = Me.textbox1.Text
    sms =System.Web.HttpUtility.UrlEncode(sms,system.Text.Encoding.GetEncoding("ISO-8859-1"))
    client.QueryString.Add("mensaje", sms)
    client.QueryString.Add("user", username)
    client.QueryString.Add("mobile", numberMbl)
    data = client.OpenRead(baseurl)
    reader = NewStreamReader(data)
    s = reader.ReadToEnd()
    data.Close()
    reader.Close()
    



    RESULTS IN VB.NET:

    user writes in textbox this text:
    the product price is 200+VAT

    VB.NET program encode this text this:
    the+product+price+is+200%2bVAT

    customer receives in his mobile this SMS:
    the product price is 200 VAT


    RESULTS IN PHP:


    user writes in textbox this text:
    t he product price is 200+VAT

    PHP program encode this text this:
    the+product+price+is+200%2bVAT

    customer receives in his mobile this SMS:
    the product price is 200+VAT

    Yo can see that the encoded text is the same in php and vb.net. But in VB.NET is lost the character +

    Then how I can pass this encoded texto to this URL?


    Thanks in advance
    Regards, manolitos
    • Edited by yaeko.m Saturday, February 20, 2010 2:39 PM
    Saturday, February 20, 2010 12:42 PM

Answers

  • ok......forget this post.

    I will write in another forum. Is not necessary not to split hairs...




    Regards, manolitos
    • Marked as answer by yaeko.m Monday, February 22, 2010 3:57 PM
    Monday, February 22, 2010 3:56 PM

All replies

  • I would recommend that you ask the question at www.asp.net. This is not a web forum.

    Renee
    Saturday, February 20, 2010 2:09 PM
  • Rene:

    my question is about Windows Form. My program is developed using Visual Basic Express Ed. Is a Windows Form app.

    For this, I have written in Visual Basic Express Edition forum

    If I put an example in PHP is to explain better my problem. Is not web app.



    Regards, manolitos
    Saturday, February 20, 2010 2:35 PM
  • But this forum does not take care of web apps. "System.Web.HttpUtility.UrlEncode(sms,system.Text.Encoding.GetEncoding("ISO-8859-1"
    Is not a problem taken care or here.

    Renee
    Saturday, February 20, 2010 2:41 PM
  • ok......forget this post.

    I will write in another forum. Is not necessary not to split hairs...




    Regards, manolitos
    • Marked as answer by yaeko.m Monday, February 22, 2010 3:57 PM
    Monday, February 22, 2010 3:56 PM