|
-
Feb 17th, 2010, 11:54 PM
#1
Thread Starter
New Member
Including a File
Alright. I need to include a text file that I host on a website, into my program. I'm not sure if you can do this, but I need to. What specific code, or object (with code) should I use, to do this?
Version Used: Microsoft Visual Basic 2008 Express Edition
-
Feb 17th, 2010, 11:57 PM
#2
Re: Including a File
There is no code. Just add the file to your project in the Solution Explorer. In a WinForms app you'd have to set the file's Copy To Output Directory property to True. I'm not sure if it's the same for a web site but you should check the file's properties to see what's there.
-
Feb 18th, 2010, 12:00 AM
#3
Thread Starter
New Member
Re: Including a File
What I'm wanting to do though, is the user download my program. Then, I be able to update the program, from the TXT file (It contains the information that the program displays). So the user does not have to redownload the program twice a week.
-
Feb 18th, 2010, 06:48 AM
#4
Re: Including a File
So what are you actually asking for? Do you want your program to download the file from your web site? If so then it's just My.Computer.Network.DownloadFile.
-
Feb 18th, 2010, 12:04 PM
#5
Thread Starter
New Member
Re: Including a File
Sorta! I want it to grab a text file. Get the contents of the file (The text file is online). Then display the contents of the file, on my form.
-
Feb 18th, 2010, 07:12 PM
#6
Re: Including a File
If you want the contents of a text file but you don't want to save the file itself then you'd create a WebClient object and call its DownloadString method.
-
Feb 18th, 2010, 07:14 PM
#7
Thread Starter
New Member
Re: Including a File
I'm not sure how to do this. I'm just now learning. Started out as a class, and now I'm wanting to take it further.
EDIT: I figured it out! Thanks so much!
Last edited by TommyEvans; Feb 18th, 2010 at 08:09 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|