Results 1 to 8 of 8

Thread: [RESOLVED] Get Text From File On Site

  1. #1

    Thread Starter
    Addicted Member GedOfEarthsea's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    145

    Resolved [RESOLVED] Get Text From File On Site

    Hello, I would like to know how to connect to a site and read a data file and have a textbox have the same text as the file. The reason so I can learn an easy way to check for updates.

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Get Text From File On Site

    Use the Internet Transfer Control (Inet):

    VB Code:
    1. Text1.Text = Inet1.OpenURL ("http://www.google.com")
    edit: For a better view, use:

    VB Code:
    1. Text1.MultiLine = True

  3. #3
    Lively Member
    Join Date
    Jan 2006
    Posts
    114

    Re: Get Text From File On Site

    i would download a spicified INI or TXT file and have the newest version stored in there, and compare it to the version stored in the your exe.

  4. #4

    Thread Starter
    Addicted Member GedOfEarthsea's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    145

    Re: Get Text From File On Site

    Is there another way to do this besides the Internet Transfer Control?
    Last edited by GedOfEarthsea; Aug 18th, 2006 at 01:39 AM.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Get Text From File On Site

    You could FTP the file. How you do it depends on how the site is set up and what permissions you have on the site.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  6. #6

    Thread Starter
    Addicted Member GedOfEarthsea's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    145

    Re: Get Text From File On Site

    Nevermind I used something I found in the API-Guide. If you are interested it was this:

    VB Code:
    1. Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    2. Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    3.     Dim lngRetVal As Long
    4.     lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    5.     If lngRetVal = 0 Then DownloadFile = True
    6. End Function
    7. Private Sub Form_Load()
    8.     'example by Matthew Gates ([email protected])
    9.     DownloadFile "http://www.allapi.net", "c:\allapi.htm"
    10. End Sub

  7. #7
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: [RESOLVED] Get Text From File On Site

    I have just recently see somebody having problems with this API. Check... this thread.

  8. #8

    Thread Starter
    Addicted Member GedOfEarthsea's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    145

    Re: [RESOLVED] Get Text From File On Site

    Thanks, I will look into it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width