Results 1 to 7 of 7

Thread: Making HTML Files

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    San Diego, California
    Posts
    67

    Post Making HTML Files

    How do you make HTML files with VB, Im pretty sure its possible, cuz Ive seen it done.

    Thanks in advanced.
    I wuv VB

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    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.

  3. #3
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    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.

  4. #4
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    352
    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    San Diego, California
    Posts
    67
    Now that I think of it thats pretty logical...

    It would probably look something like this then.

    VB Code:
    1. 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

  6. #6
    Lively Member
    Join Date
    Sep 2002
    Posts
    89
    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

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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:
    1. Open "c:\somefile.html" For Output As #1
    2.     Print #1, "<html><b>Poop</b></html>"
    3. 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
  •  



Click Here to Expand Forum to Full Width