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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    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?


  • Larry Serflaten

    #2
    Re: 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[color=blue]
    > 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?[/color]


    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! =-----

    Comment

    • Slaatje

      #3
      Re: simple problem, no one has an answer it seems...


      jjd228@NOSPAMop tonline.net heeft geschreven in bericht ...[color=blue]
      >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?
      >[/color]


      Duh!

      Const scUserAgent = "API-Guide test program"
      Const INTERNET_OPEN_T YPE_DIRECT = 1
      Const INTERNET_OPEN_T YPE_PROXY = 3
      Const INTERNET_FLAG_R ELOAD = &H80000000
      Const sURL = "http://www.microsoft.c om/index.htm"
      Private Declare Function InternetOpen Lib "wininet" Alias "InternetOp enA"
      (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 InternetCloseHa ndle Lib "wininet" (ByRef hInet As
      Long) As Long
      Private Declare Function InternetReadFil e Lib "wininet" (ByVal hFile As
      Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long,
      lNumberOfBytesR ead As Long) As Integer
      Private Declare Function InternetOpenUrl Lib "wininet" Alias
      "InternetOpenUr lA" (ByVal hInternetSessio n 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: KPDTeam@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(sc UserAgent, INTERNET_OPEN_T YPE_DIRECT,
      vbNullString, vbNullString, 0)
      'Open the url
      hFile = InternetOpenUrl (hOpen, sURL, vbNullString, ByVal 0&,
      INTERNET_FLAG_R ELOAD, ByVal 0&)
      'Read the first 1000 bytes of the file
      InternetReadFil e hFile, sBuffer, 1000, Ret
      'clean up
      InternetCloseHa ndle hFile
      InternetCloseHa ndle hOpen
      'Show our file
      MsgBox sBuffer
      End Sub

      If this doesn't work...



      Comment

      • Goldenpi

        #4
        Re: simple problem, no one has an answer it seems...


        <jjd228@NOSPAMo ptonline.net> wrote in message
        news:vPfNb.3572 8$G04.7390380@n ews4.srv.hcvlny .cv.net...[color=blue]
        > i have a text file on a webserver. i need to read the text in the file[/color]
        with[color=blue]
        > a vb app. thats all. ive played around with the webbrowser control but[/color]
        cant[color=blue]
        > 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?
        >
        >[/color]

        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.


        Comment

        Working...