473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Create a HTML file programatically

Hello !
With c# , I want to create a HTML file programatically .
How can I do it ?
Thank U !
May 16 '06 #1
9 4357
What exactly do you need assisstance for? Creating file? Forming html? And
what is the file for? May be you don't need in the first place?

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Hello !
With c# , I want to create a HTML file programatically .
How can I do it ?
Thank U !

May 16 '06 #2
Eliyahu ,
I want to know how I open a new html file , write to the file in specific
font and colour.
The file intend to give indications about success and failure of some
operations (documentation ).
Thanks,

"Eliyahu Goldin" wrote:
What exactly do you need assisstance for? Creating file? Forming html? And
what is the file for? May be you don't need in the first place?

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Hello !
With c# , I want to create a HTML file programatically .
How can I do it ?
Thank U !


May 16 '06 #3
Nir,

See if you need anything else apart from the following operations:

Open a file:
StreamWriter sw = new StreamWriter("TestFile.txt");

Write your html there:
sw.Write ("<span style='color:red'>Error</span>");

Close the stream:
sw.Close();

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Eliyahu ,
I want to know how I open a new html file , write to the file in specific
font and colour.
The file intend to give indications about success and failure of some
operations (documentation ).
Thanks,

"Eliyahu Goldin" wrote:
What exactly do you need assisstance for? Creating file? Forming html?
And
what is the file for? May be you don't need in the first place?

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
> Hello !
> With c# , I want to create a HTML file programatically .
> How can I do it ?
> Thank U !


May 16 '06 #4
Thank U very very much !

"Eliyahu Goldin" wrote:
Nir,

See if you need anything else apart from the following operations:

Open a file:
StreamWriter sw = new StreamWriter("TestFile.txt");

Write your html there:
sw.Write ("<span style='color:red'>Error</span>");

Close the stream:
sw.Close();

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Eliyahu ,
I want to know how I open a new html file , write to the file in specific
font and colour.
The file intend to give indications about success and failure of some
operations (documentation ).
Thanks,

"Eliyahu Goldin" wrote:
What exactly do you need assisstance for? Creating file? Forming html?
And
what is the file for? May be you don't need in the first place?

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
> Hello !
> With c# , I want to create a HTML file programatically .
> How can I do it ?
> Thank U !


May 16 '06 #5
Eliyahu ,
For this line:
StreamWriter sw = new StreamWriter("TestFile.txt");
The suffix need to be : "html" and not "txt" ?!

"Eliyahu Goldin" wrote:
Nir,

See if you need anything else apart from the following operations:

Open a file:
StreamWriter sw = new StreamWriter("TestFile.txt");

Write your html there:
sw.Write ("<span style='color:red'>Error</span>");

Close the stream:
sw.Close();

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
Eliyahu ,
I want to know how I open a new html file , write to the file in specific
font and colour.
The file intend to give indications about success and failure of some
operations (documentation ).
Thanks,

"Eliyahu Goldin" wrote:
What exactly do you need assisstance for? Creating file? Forming html?
And
what is the file for? May be you don't need in the first place?

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
> Hello !
> With c# , I want to create a HTML file programatically .
> How can I do it ?
> Thank U !


May 16 '06 #6
Yes, sure. Also you might have to take care about your asp.net account
security rights.

Note, that the file will be written in the application directory.

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Eliyahu ,
For this line:
StreamWriter sw = new StreamWriter("TestFile.txt");
The suffix need to be : "html" and not "txt" ?!

"Eliyahu Goldin" wrote:
Nir,

See if you need anything else apart from the following operations:

Open a file:
StreamWriter sw = new StreamWriter("TestFile.txt");

Write your html there:
sw.Write ("<span style='color:red'>Error</span>");

Close the stream:
sw.Close();

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
> Eliyahu ,
> I want to know how I open a new html file , write to the file in
> specific
> font and colour.
> The file intend to give indications about success and failure of some
> operations (documentation ).
> Thanks,
>
> "Eliyahu Goldin" wrote:
>
>> What exactly do you need assisstance for? Creating file? Forming html?
>> And
>> what is the file for? May be you don't need in the first place?
>>
>> Eliyahu
>>
>> "Niron kag" <Ni******@discussions.microsoft.com> wrote in message
>> news:55**********************************@microsof t.com...
>> > Hello !
>> > With c# , I want to create a HTML file programatically .
>> > How can I do it ?
>> > Thank U !
>>
>>
>>


May 16 '06 #7
Can't I write the file to general directory like c:\ ?

"Eliyahu Goldin" wrote:
Yes, sure. Also you might have to take care about your asp.net account
security rights.

Note, that the file will be written in the application directory.

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Eliyahu ,
For this line:
StreamWriter sw = new StreamWriter("TestFile.txt");
The suffix need to be : "html" and not "txt" ?!

"Eliyahu Goldin" wrote:
Nir,

See if you need anything else apart from the following operations:

Open a file:
StreamWriter sw = new StreamWriter("TestFile.txt");

Write your html there:
sw.Write ("<span style='color:red'>Error</span>");

Close the stream:
sw.Close();

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
> Eliyahu ,
> I want to know how I open a new html file , write to the file in
> specific
> font and colour.
> The file intend to give indications about success and failure of some
> operations (documentation ).
> Thanks,
>
> "Eliyahu Goldin" wrote:
>
>> What exactly do you need assisstance for? Creating file? Forming html?
>> And
>> what is the file for? May be you don't need in the first place?
>>
>> Eliyahu
>>
>> "Niron kag" <Ni******@discussions.microsoft.com> wrote in message
>> news:55**********************************@microsof t.com...
>> > Hello !
>> > With c# , I want to create a HTML file programatically .
>> > How can I do it ?
>> > Thank U !
>>
>>
>>


May 16 '06 #8
You can if you wish.

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:3D**********************************@microsof t.com...
Can't I write the file to general directory like c:\ ?

"Eliyahu Goldin" wrote:
Yes, sure. Also you might have to take care about your asp.net account
security rights.

Note, that the file will be written in the application directory.

Eliyahu

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
> Eliyahu ,
> For this line:
> StreamWriter sw = new StreamWriter("TestFile.txt");
> The suffix need to be : "html" and not "txt" ?!
>
> "Eliyahu Goldin" wrote:
>
>> Nir,
>>
>> See if you need anything else apart from the following operations:
>>
>> Open a file:
>> StreamWriter sw = new StreamWriter("TestFile.txt");
>>
>> Write your html there:
>> sw.Write ("<span style='color:red'>Error</span>");
>>
>> Close the stream:
>> sw.Close();
>>
>> Eliyahu
>>
>> "Niron kag" <Ni******@discussions.microsoft.com> wrote in message
>> news:E6**********************************@microsof t.com...
>> > Eliyahu ,
>> > I want to know how I open a new html file , write to the file in
>> > specific
>> > font and colour.
>> > The file intend to give indications about success and failure of
>> > some
>> > operations (documentation ).
>> > Thanks,
>> >
>> > "Eliyahu Goldin" wrote:
>> >
>> >> What exactly do you need assisstance for? Creating file? Forming
>> >> html?
>> >> And
>> >> what is the file for? May be you don't need in the first place?
>> >>
>> >> Eliyahu
>> >>
>> >> "Niron kag" <Ni******@discussions.microsoft.com> wrote in message
>> >> news:55**********************************@microsof t.com...
>> >> > Hello !
>> >> > With c# , I want to create a HTML file programatically .
>> >> > How can I do it ?
>> >> > Thank U !
>> >>
>> >>
>> >>
>>
>>
>>


May 16 '06 #9
An HTML file is a text file, so you can use a StreamWriter to write the text.

See a simple example at :
http://aspnet.4guysfromrolla.com/art...72303-1.2.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Hello !
With c# , I want to create a HTML file programatically .
How can I do it ?
Thank U !

May 16 '06 #10

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

Similar topics

15
by: Viviana Vc | last post by:
How can I programatically do the equivalent of the following: cacls "C:\Program Files\test" /T /G Everyone:f ? Thanks, Viv
7
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element...
0
by: spamfurnace | last post by:
Hi there on this rainy old day, I have some users logging into an asp.net website. The server the site sits on allows users to webmail through a common service/component called Horde. In order...
3
by: The Woo | last post by:
Can one programatically create a file folder which has the same name as a key field, using a command button? Or, Can there be a a command button which opens up a directory tree to a specified...
7
by: Supriya | last post by:
Hi All, Is there any way to create .chm file programmatically? Please let me know. Thanks in advance. Supriya
1
by: vijay | last post by:
HI ALL, How to create excel chart programatically using C#.net 2005. I have created an excel file by using Gembox.Spreadsheet component.Now i want to add excel Chart to this...
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.