473,699 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create an HTML file

Does anyone have an example in VB.NET on how to create an HTML file.
Jan 25 '06 #1
6 1342
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
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***@discussi ons.microsoft.c om> wrote in message
news:96******** *************** ***********@mic rosoft.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
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***@discussi ons.microsoft.c om> wrote in message
news:96******** *************** ***********@mic rosoft.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
"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
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***@discussi ons.microsoft.c om> wrote in message
news:36******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:96******** *************** ***********@mic rosoft.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
On Wed, 25 Jan 2006 14:17:06 -0800, "JackO"
<Ja***@discussi ons.microsoft.c om> 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.WriteLin e("<html>");
writer.WriteLin e("<head>");
writer.WriteLin e(" <title>My HTML Page</title>");
writer.WriteLin e("</head>");
writer.WriteLin e("<body>");
writer.WriteLin e(" <h1>Hello World!</h1>");
writer.WriteLin e("</body>");
writer.WriteLin e("</html>");

writer.Close();

HTH

rossum
--

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2128
by: bissatch | last post by:
Hi, I am currently working on a content management system where a user can fill in a form (title, keywords, link text etc. - all the initial attibutes), which when submitted, will go onto create a web page. The code is as follows: $html = "<html>\n<body>\n<p>Hello World</p>\n</body>\n<html>"; $handle = fopen($_SERVER."/path/to/folder/".$filename,
7
8859
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
9
2299
by: Marc Miller | last post by:
Hi all, I have 2 dev. machines, the 1st is Win 2000 with .NET 7.0 and the 2nd is XP Pro with .NET 2003. My Web Server is Win 2000 Server with IIS 5.0. I can create a new project on my test server from the 1st machine, but I receive an 'HTTP/1.1 500 Internal Server error" from my Web Server. My userid/password are the same on all 3 machines.
11
3430
by: mesut demir | last post by:
Hi All, When I create fields (in files) I need assign a data type like char, varchar, money etc. I have some questions about the data types when you create fields in a file. What is the difference between data type 'CHAR' and 'TEXT'? When do you use 'VAR' in your datatype word? e.g. VARCHAR ?
6
3678
by: windandwaves | last post by:
Hi Folk Some of my clients asked me to create "fancy emails" for them (aka html formatted emails). I know how to make a nice html document, but I had trouble creating a simple way to provide the document to my clients so that they could use it to. I know most of them use Outlook XP or Outlook 2003, so what I created was a page that creates a Visual Basic script that, when saved to the desktop and
5
6770
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would cause. If I could create a large file that could be encrypted, and maybe add files to it by appending them and putting in some kind of delimiter between files, maybe a homemade version of truecrypt could be constructed. Any idea what it...
8
20362
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
5
1935
by: susinthaa | last post by:
Hi I tried to create a file using sysopen command as the following sysopen( SUSI,'c:\\susi.html',O_RDWR|O_EXCL|O_CREAT, 0755); printf HTML "<html>\n"; printf HTML "<head>\n"; printf HTML "<title>Susintha Home page</title>; printf HTML "</head>\n"; printf HTML "<body>\n";
15
5269
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
3732
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path. Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.