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
  1. Home
  2. General Programming
  3. Visual Basic
  4. using the internet transfer control

using the internet transfer control

Scheduled Pinned Locked Moved Visual Basic
helpquestion
2 Posts 2 Posters 0 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.
  • K Offline
    K Offline
    kimrune
    wrote on last edited by
    #1

    Hey.. I would like to use the internet transfer control, but when adding this code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Inet1.Protocol = icHTTP Inet1.URL = Text1.Text Inet1.Execute(, "GET") End Sub I get build errors saying that Inet1 is not declared... I probably need to add some controls, but the problem is, I don't know from where? I can't find any control in the tool box or wherever that has anything to do with the internet transfer control? Would appreciate some help here :)

    A 1 Reply Last reply
    0
    • K kimrune

      Hey.. I would like to use the internet transfer control, but when adding this code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Inet1.Protocol = icHTTP Inet1.URL = Text1.Text Inet1.Execute(, "GET") End Sub I get build errors saying that Inet1 is not declared... I probably need to add some controls, but the problem is, I don't know from where? I can't find any control in the tool box or wherever that has anything to do with the internet transfer control? Would appreciate some help here :)

      A Offline
      A Offline
      AirGuitarist
      wrote on last edited by
      #2

      You can add the internet transfer control by adding a reference to the msinet.ocx activex component. First, right click on the project name in solution explorer, and go to Add Reference -> COM -> Browse. Browse for MSINET.OCX, it should be in your system directory (usually c:\windows\system32 for winXP). .NET will automatically reference the object and create a managed wrapper class for it (in the form of AxCLASSNAME). You can then add this component into your project. There are however, drawbacks to this. Wrapping an ActiveX control in .NET increases overhead. There are a few solutions built into .NET that come to mind. 1) The easiest solution uses the System.Net namespace and the HttpWebRequest and HttpWebResponse classes. You can use these classes to retrieve whatever document you wish using the HTTP protocol. For more information, see the HttpWebResponse class by navigating your VS.NET help to the following: ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemnethttpwebresponseclasstopic.htm 2) The second solutions gives you far more control by using sockets directly. By using the System.Net.Socket class, you can create to a remote host (port 80 is usually HTTP port), and the form a GET request using the HTTP protocol. This solution is not recommended because .NET has already built classes to handle http requests (solution #1). This class can be used for custom protocols. - Joe

      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