|
-
Dec 23rd, 2002, 07:56 PM
#1
Thread Starter
Lively Member
Making HTML Files
How do you make HTML files with VB, Im pretty sure its possible, cuz Ive seen it done.
Thanks in advanced.
-
Dec 23rd, 2002, 08:42 PM
#2
PowerPoster
HTML files are pure text (aka "flat files") and can be created with any programming language including VB. If you mean having VB create HTML files with VB (as opposed to you) having some understanding of the content, then I've misunderstood your question and do not know the answer.
-
Dec 23rd, 2002, 08:45 PM
#3
PowerPoster
As an example of what I mean, look at the site
http://www.hobbithouseinc.com/personal/woodpics
There are over 1000 HTML files on that site and all but about 8 or 9 of them were created with VB (and many were then modified by me to have some specific content, but all "href", "img src" and so forth, lines in each HTML file were all created by a VB app that I wrote.
-
Dec 23rd, 2002, 08:46 PM
#4
Hyperactive Member
he's basically asking how to createa file. Look in planetsourcecode for the code to make one (it's a couple of lines i believe, don't remember it exactly) and then name it *.htm or *.html and just put the contents in it like a normal txt file.
-
Dec 23rd, 2002, 09:07 PM
#5
Thread Starter
Lively Member
Now that I think of it thats pretty logical...
It would probably look something like this then.
VB Code:
Name "index.txt" As "index.html"
Since there wont be a text file to begin with, so I need it to be made. So how do I create one.
Last edited by Cornflake; Dec 23rd, 2002 at 09:12 PM.
I wuv VB
-
Dec 23rd, 2002, 09:22 PM
#6
Lively Member
Either use the file handling stuff in VB (Open, Write etc) or cheat using the FileSystemObject (have a look at the CreateTextFile method of the FileSystemObject)
- gaffa
-
Dec 23rd, 2002, 09:23 PM
#7
You can write to any file type that you want. Its up to the program interpreting the file to know whether or not its the correct format.
To create a file...
VB Code:
Open "c:\somefile.html" For Output As #1
Print #1, "<html><b>Poop</b></html>"
Close #1
Then find "C:\somefile.html" and open it up.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
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
|