473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Retreive a CSV file from website??

Don

In VB6 I used MSXML to retreive a CSV file from a web site so I could
parse it and save to a Db. What is the best way to accomplish this
with VB.NET?

VB6 Code:

Dim HTTPObj As MSXML2.XMLHTTP

sURL = "http://download.lender.com/rates/BROKER.CSV"
Set HTTPObj = New MSXML2.XMLHTTP
HTTPObj.open "get", sURL, False
HTTPObj.Send
sPage = HTTPObj.responseText
Lines = Split(sPage, vbLf)

Thank you,

Don
Redmond, WA
Nov 20 '05 #1
2 1893
Hi Don,

The following should do the trick

Regards,
Fergus

<code>
Public Function GetTextFrom (sUrl As String) As String
Dim oRequest As WebRequest = WebRequest.Create(sUrl)
Dim oResponse As HttpWebResponse _
= DirectCast (oRequest.GetResponse(), HttpWebResponse)

Dim oStream As New StreamReader (oResponse.GetResponseStream)
Dim sText As String = oStream.ReadToEnd

oStream.Close
oResponse.Close()

Return sText
End Function
</code>
Nov 20 '05 #2
Don

Perfect, thank you for helping.

Don
Redmond, WA
On Sat, 4 Oct 2003 01:00:15 +0100, "Fergus Cooney"
<fi******@tesco.net> wrote:
Hi Don,

The following should do the trick

Regards,
Fergus

<code>
Public Function GetTextFrom (sUrl As String) As String </code>


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lee | last post by:
Hello, This is a genral enquiry before I send out a more detailed request. I am unable to retreive image files from a mysql database using IE 5.2 on the mac OS X platform. I have built a...
3
by: Not4u | last post by:
I would like to know which products are my best sells by sellers, but i would like to retreive this info by product id, seller id and the total amount of sells for this product. My Sells table...
3
by: AlexGreif.2609394 | last post by:
Hi, I looked at the PIL Image class but cannot see a posibility to retreive the image resolution dots per inch (or pixels per inch) Could somebody please tell me how to get these metadata infos...
2
by: LisaB | last post by:
I am new to Visual Basic .Net and would like to build a simple application that searches a directory and returns the Path, Size and DateModified of all files that end in ".MDB". a) I would...
1
by: Jean Christophe Avard | last post by:
Hi! I have a dataset where I have a field that is a image. I can't figure out how to retreive the imahe, I get the invalid paranmeter with this code... Try Dim buffer() As Byte =...
1
by: Sudhakara.T.P. | last post by:
Hi, I have an application in VB.NET windows application, wherein the administrator has the option to change the authentication mode ie., whether the application should work as a normal database...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
0
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
4
by: AkMaLiTo | last post by:
hi... i am in a mess, i need to use visual basic 6 with sql server 2000 database.. could someone tell me the best component to use with sql ? the project is as follow: retreive table names in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.