WebClient urgent question !! ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ucasesoftware

    #1

    WebClient urgent question !! ??

    Dim url = "http://www.myUrl/hello.aspx?name =Sébastien"

    if i do process.Start(u rl)
    i receive Sébastien

    if i do :
    Dim data As Stream = client.OpenRead (url)
    Dim reader As New StreamReader(da ta)
    Dim webResult As String = reader.ReadToEn d()
    data.Close()
    reader.Close()
    myForms.formPat ientezSms.Close ()

    i received SAbastien

    Someone could help !! ???

  • ucasesoftware

    #2
    Re: WebClient urgent question !! ??

    sorry i forget :
    Dim client As New System.Net.WebC lient
    client.Headers. Add("user-agent", "Mozilla/4.0
    (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)")

    Dim data As Stream = client.OpenRead (url)
    Dim reader As New StreamReader(da ta)
    Dim webResult As String = reader.ReadToEn d()
    data.Close()
    reader.Close()
    myForms.formPat ientezSms.Close ()

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: WebClient urgent question !! ??

      "ucasesoftw are" <ucasesoftware@ hotmail.fr> schrieb:[color=blue]
      >Dim url = "http://www.myUrl/hello.aspx?name =Sébastien"
      >
      >if i do process.Start(u rl)
      >i receive Sébastien
      >
      >if i do :
      >Dim data As Stream = client.OpenRead (url)
      > Dim reader As New StreamReader(da ta)
      >[...]
      >i received SAbastien[/color]

      You may want to specify an appropriate 'System.Text.En coding' in the
      'StreamReader'' s constructor.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      Working...