VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This snippet downloads data from a URI and prints it to the console.

by Syed (1 Submission)
Category: Internet/HTML
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Sun 7th December 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This snippet downloads data from a URI and prints it to the console.

Rate This snippet downloads data from a URI and prints it to the console.



Imports System.Net
Imports System.Text

public class WebReq

   Shared Sub Main()
        Dim uri As New Uri("http://www.cy2online.net")

        Dim request As WebRequest = WebRequest.Create(uri)
        Dim response As WebResponse = request.GetResponse()

        Dim stream As Stream = response.GetResponseStream()
        Dim reader As New StreamReader(stream)
        Dim data As String = reader.ReadToEnd()
        reader.Close()
        stream.Close()
        Console.WriteLine(data)
   End Sub 

Download this snippet    Add to My Saved Code

This snippet downloads data from a URI and prints it to the console. Comments

No comments have been posted about This snippet downloads data from a URI and prints it to the console.. Why not be the first to post a comment about This snippet downloads data from a URI and prints it to the console..

Post your comment

Subject:
Message:
0/1000 characters