By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,496 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,496 IT Pros & Developers. It's quick & easy.

Create an HTML file

P: n/a
Does anyone have an example in VB.NET on how to create an HTML file.
Jan 25 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Actually I would like an example in VB code for ASP.NET

"JackO" wrote:
Does anyone have an example in VB.NET on how to create an HTML file.

Jan 25 '06 #2

P: n/a
What do you mean. An HTML file is simply a text files with elements, so you
should be able generate the necessary string and write it out using the
FileStream. I assume this is not what you are looking for so can you
clarify your question.

"JackO" <Ja***@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
Actually I would like an example in VB code for ASP.NET

"JackO" wrote:
Does anyone have an example in VB.NET on how to create an HTML file.

Jan 25 '06 #3

P: n/a
Yes, I guess I am looking for an example of the FileStream method that would
take a string and write it out as a *.htm file

"Peter Rilling" wrote:
What do you mean. An HTML file is simply a text files with elements, so you
should be able generate the necessary string and write it out using the
FileStream. I assume this is not what you are looking for so can you
clarify your question.

"JackO" <Ja***@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
Actually I would like an example in VB code for ASP.NET

"JackO" wrote:
Does anyone have an example in VB.NET on how to create an HTML file.


Jan 25 '06 #4

P: n/a
"JackO" wrote:
Yes, I guess I am looking for an example of the FileStream method that
would
take a string and write it out as a *.htm file


....and the string we're talking about already contains all HTML-tags?

Steven

- - -
Jan 26 '06 #5

P: n/a
You just create a text file with a .htm extension, and write the text to it,
just like you would write to any text file.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"JackO" <Ja***@discussions.microsoft.com> wrote in message
news:36**********************************@microsof t.com...
Yes, I guess I am looking for an example of the FileStream method that
would
take a string and write it out as a *.htm file

"Peter Rilling" wrote:
What do you mean. An HTML file is simply a text files with elements, so
you
should be able generate the necessary string and write it out using the
FileStream. I assume this is not what you are looking for so can you
clarify your question.

"JackO" <Ja***@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
> Actually I would like an example in VB code for ASP.NET
>
> "JackO" wrote:
>
>> Does anyone have an example in VB.NET on how to create an HTML file.


Jan 26 '06 #6

P: n/a
On Wed, 25 Jan 2006 14:17:06 -0800, "JackO"
<Ja***@discussions.microsoft.com> wrote:
Does anyone have an example in VB.NET on how to create an HTML file.


This is in C#, but it should be reasonably similar to VB:

StreamWriter writer = new
StreamWriter(@"C:\myDirectory\myHTMLFile.htm", false);

writer.WriteLine("<html>");
writer.WriteLine("<head>");
writer.WriteLine(" <title>My HTML Page</title>");
writer.WriteLine("</head>");
writer.WriteLine("<body>");
writer.WriteLine(" <h1>Hello World!</h1>");
writer.WriteLine("</body>");
writer.WriteLine("</html>");

writer.Close();

HTH

rossum
--

The ultimate truth is that there is no ultimate truth
Jan 26 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.