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. Reading a file in the internet

Reading a file in the internet

Scheduled Pinned Locked Moved Visual Basic
questioncsharpcomhelp
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.
  • R Offline
    R Offline
    re infecta
    wrote on last edited by
    #1

    I need to read the contents of a file that is located in the internet. The problem is that this file is located in a folder that needs username "ukkeli" and password "hattu123". I'm using the code below: Dim myWebClient As New System.Net.WebClient 'the webclient Dim file As New System.IO.StreamReader(myWebClient.OpenRead("http://www.examplesite.com/subdir/file.txt")) Dim Contents As String = file.ReadToEnd() file.Close() How can I make the application to give the needed username and password automatically?

    N 1 Reply Last reply
    0
    • R re infecta

      I need to read the contents of a file that is located in the internet. The problem is that this file is located in a folder that needs username "ukkeli" and password "hattu123". I'm using the code below: Dim myWebClient As New System.Net.WebClient 'the webclient Dim file As New System.IO.StreamReader(myWebClient.OpenRead("http://www.examplesite.com/subdir/file.txt")) Dim Contents As String = file.ReadToEnd() file.Close() How can I make the application to give the needed username and password automatically?

      N Offline
      N Offline
      ne0h
      wrote on last edited by
      #2

      it might be HTTP authentication. Try that.

      ---------------------------- **** JOB23743 Submitted ****

      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