Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. WebBrowser control

WebBrowser control

Scheduled Pinned Locked Moved C#
csharpvisual-studiosysadminhelptutorial
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hung_ngole
    wrote on last edited by
    #1

    Hi, I'm using WebBrowser control of VS.NET 2005. I have handled the Navigate event of this control but I don't know how to get the data on the request object before it is sent to server. Thanks for any help! Hung

    N 1 Reply Last reply
    0
    • H hung_ngole

      Hi, I'm using WebBrowser control of VS.NET 2005. I have handled the Navigate event of this control but I don't know how to get the data on the request object before it is sent to server. Thanks for any help! Hung

      N Offline
      N Offline
      Nafiseh Salmani
      wrote on last edited by
      #2

      i cant get your mean!! but i think this code may help you. change the property Url to about:blank drop a button to form1 (leave the button1 as name) bouble click on the button1 and paste following code as event handler private void button1_Click(object sender, EventArgs e) { System.IO.MemoryStream st = new System.IO.MemoryStream (); string sampleHtml = "Hello world! "; UTF8Encoding uniEncoding = new UTF8Encoding(); byte[] firstString = uniEncoding.GetBytes(sampleHtml); webBrowser1.DocumentStream = st; st.Write(firstString, 0, firstString.Length); st.Flush(); st.Position = 0; webBrowser1.DocumentStream = st; }

      H 1 Reply Last reply
      0
      • N Nafiseh Salmani

        i cant get your mean!! but i think this code may help you. change the property Url to about:blank drop a button to form1 (leave the button1 as name) bouble click on the button1 and paste following code as event handler private void button1_Click(object sender, EventArgs e) { System.IO.MemoryStream st = new System.IO.MemoryStream (); string sampleHtml = "Hello world! "; UTF8Encoding uniEncoding = new UTF8Encoding(); byte[] firstString = uniEncoding.GetBytes(sampleHtml); webBrowser1.DocumentStream = st; st.Write(firstString, 0, firstString.Length); st.Flush(); st.Position = 0; webBrowser1.DocumentStream = st; }

        H Offline
        H Offline
        hung_ngole
        wrote on last edited by
        #3

        Thank nafiseh_salmani, but the Document.Stream just get the source of HTML Page not a data on a request send to server. I mean that: I have a HTML page and it have some javascript function, this script will send request to server when the form is loading. Now I want to manage all the request send to server because I want to change somethings on this request. If I use VB.NET code to manage all requests, how can I do? Thanks for your help! Hung

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups