Creating HTML Pages.

daryl4356

Member
Joined
May 30, 2006
Messages
13
Programming Experience
Beginner
Hi all.

I am attempting to write an application which i need to use to create 20,000 html pages. They are all very basic and will be named as 2 sets of 00001.html up to 10000.html.

The contents of these pages will be pretty much the same apart from 4 individual lines which will need to be a mixtureof 40 or so different values.

I was going to write an application that would create a text file called its relevant number. I would then write each line into this text file and then rename it to .html (and hope for the best :D .

I am quite a novice at programming so is this the simplest way or could any of you point out a simpler way or give me some guidance on the best way to do this.

I would rather get some help and get this working in a simple way before i attempt all the above and end up with no HTML files :confused:

any help would be greatly appreciated.

Thanks
Daryl
 
An HTML file IS a text file. It just has a different extension so Windows knows how to handle it. It still contains plain text though, so you can write an HTML file directly just like you can a TXT file, using a StreamWriter or the My.Computer.FileSystem object. The easiest way, if you need to do this more than once, would be to create a template HTML file with place-holders for the parts that need to be set. You then add that file to your project as a resource. At run time you retrieve the resource, use String.Format to replace the place-holders with the appropriate text and then use My.Computer.FileSystem.WriteAllText to write your HTML file to disk. Done.
 
Back
Top