Down .csv text file from Intranet

JamesBurley
05-08-2004, 06:04 PM
Hello everyone,

I am new to Visual Basic.NET and I am currently stumped on part of my project. I want to be able to download a text.csv file from htxp://blah.com/blah2/blah3/text.csv and save it as C:\text.csv. This is a Windows Application program coded in Visual Basic.NET 2002 Pro.

Thanks in advance,

JB

MKoslof
05-08-2004, 07:55 PM
You should be able to use the .Net web client for this.



'within a button click

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim MyWebClient As New System.Net.WebClient()
Dim siteToGet As String

siteToGet = Me.TextBox1.Text
MyWebClient.DownloadFile(siteToGet, "C:\text.csv")

End Sub

JamesBurley
05-08-2004, 09:07 PM
You should be able to use the .Net web client for this.



'within a button click

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim MyWebClient As New System.Net.WebClient()
Dim siteToGet As String

siteToGet = Me.TextBox1.Text
MyWebClient.DownloadFile(siteToGet, "C:\text.csv")

End Sub



You are awesome, that works great! Thanks you so much.

MKoslof
05-09-2004, 08:29 AM
No problem, glad to help. .Net is quite big. It just takes some time to learn all the classes and libraries. Good luck.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum