473,385 Members | 1,707 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,385 software developers and data experts.

simple problem, no one has an answer it seems...

i have a text file on a webserver. i need to read the text in the file with
a vb app. thats all. ive played around with the webbrowser control but cant
figure out if thats what i need. if its an html file im reading, i need to
get the html source, same with an asp page.... how can i do this?
Jul 17 '05 #1
3 1846
> i have a text file on a webserver. i need to read the text in the file with
a vb app. thats all. ive played around with the webbrowser control but cant
figure out if thats what i need. if its an html file im reading, i need to
get the html source, same with an asp page.... how can i do this?

Google is your friend. The WebBrowser exposes a Document property.
Find examples of its use at google.com.

LFS


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #2

jj****@NOSPAMoptonline.net heeft geschreven in bericht ...
i have a text file on a webserver. i need to read the text in the file with
a vb app. thats all. ive played around with the webbrowser control but cant
figure out if thats what i need. if its an html file im reading, i need to
get the html source, same with an asp page.... how can i do this?

Duh!

Const scUserAgent = "API-Guide test program"
Const INTERNET_OPEN_TYPE_DIRECT = 1
Const INTERNET_OPEN_TYPE_PROXY = 3
Const INTERNET_FLAG_RELOAD = &H80000000
Const sURL = "http://www.microsoft.com/index.htm"
Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA"
(ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As
String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet" (ByRef hInet As
Long) As Long
Private Declare Function InternetReadFile Lib "wininet" (ByVal hFile As
Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long,
lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetOpenUrl Lib "wininet" Alias
"InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String,
ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As
Long, ByVal dwContext As Long) As Long
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KP*****@Allapi.net

Dim hOpen As Long, hFile As Long, sBuffer As String, Ret As Long
'Create a buffer for the file we're going to download
sBuffer = Space(1000)
'Create an internet connection
hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT,
vbNullString, vbNullString, 0)
'Open the url
hFile = InternetOpenUrl(hOpen, sURL, vbNullString, ByVal 0&,
INTERNET_FLAG_RELOAD, ByVal 0&)
'Read the first 1000 bytes of the file
InternetReadFile hFile, sBuffer, 1000, Ret
'clean up
InternetCloseHandle hFile
InternetCloseHandle hOpen
'Show our file
MsgBox sBuffer
End Sub

If this doesn't work...

Jul 17 '05 #3

<jj****@NOSPAMoptonline.net> wrote in message
news:vP*********************@news4.srv.hcvlny.cv.n et...
i have a text file on a webserver. i need to read the text in the file with a vb app. thats all. ive played around with the webbrowser control but cant figure out if thats what i need. if its an html file im reading, i need to
get the html source, same with an asp page.... how can i do this?


Just take a winsock control and write a quick HTTP client. Its a very simple
protocol if you use minimal error handling. You send one line, you get the
file back.
Jul 17 '05 #4

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

Similar topics

1
by: Howard | last post by:
Hi, I am using a very simple xslt file to get info from an xml document. The problem seems to me to be that the xml doc uses a namespace, and I don't know how to set up my xslt to recognize it...
2
by: not | last post by:
Hello All, I am trying to develop a relatively simple self-quiz form in javascript, but I'm having no luck getting it to work. What I am looking for is a script that allow the user to select...
6
by: Burt | last post by:
I need to put up a simple modal dialog, and am surprised how hard it seems to be. Am I missing something here? I have created a dialog resource IDD_DELETE_S9. It has some static text plus 3...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
50
by: Doug | last post by:
I can't imagine this is that hard but I'm sure having a struggle finding it. How do I convert a value like "111403" do a DateTime variable in DotNet (i.e. 11/14/2003)?
4
by: Duncan | last post by:
Hi I'm learning c# 2.0 as I feel I need to be able to switch between vb & c#, I'm just starting with a few simple examples and I've come across a problem. I've got two forms ones an MDI parent &...
7
by: javedna | last post by:
Hi guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to...
3
by: writser | last post by:
hey all, For my study I'm writing a simple threaded webcrawler and I am trying to do this in python. But somehow, using threads causes IDLE to crash on Windows XP (with the latest python...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.