Home All Groups Group Topic Archive Search About
Author
2 Jul 2006 4:22 PM
ailon10
well i want to edit simple html file :
first i create it :
system.io.file.create("C:\filename.html")
what i shold do to edit it i mean i want to insert into it
<html>
<head>
<title> TextTextText </title>
</head>
<body>
TextBox1.Text
</body>
</html>


how do i edit it ?
tnx

Author
2 Jul 2006 4:28 PM
Pascal
--
bonjour

I think with a streamwriter...

http://www.scalpa.info
Author
2 Jul 2006 4:40 PM
ailon10
Pascal wrote:
> --
> bonjour
>
> I think with a streamwriter...
>
> http://www.scalpa.info


can you give me expamle plz ?
Author
2 Jul 2006 4:59 PM
iwdu15
well you can just have a multi ;line text box or a richtext control and have
the user tpye in

<html>
<head>
......


then, when you want to write it to a file

DIm fs as new IO.FileSTream("C:\MyHTMLDoc.html", FileMode.Create,
FIleAccess.Write)

DIm sw as new IO.StreamWriter(fs)

then just say, to write the file

sw.WriteLine(me.txtHTML.text)

that will  write the complete text as you see it

dont forget to close your streams by calling the fs.close and sw.close methods
--
-iwdu15
Author
2 Jul 2006 5:08 PM
ailon10
iwdu15 wrote:
Show quoteHide quote
> well you can just have a multi ;line text box or a richtext control and have
> the user tpye in
>
> <html>
> <head>
> .....
>
>
> then, when you want to write it to a file
>
> DIm fs as new IO.FileSTream("C:\MyHTMLDoc.html", FileMode.Create,
> FIleAccess.Write)
>
> DIm sw as new IO.StreamWriter(fs)
>
> then just say, to write the file
>
> sw.WriteLine(me.txtHTML.text)
>
> that will  write the complete text as you see it
>
> dont forget to close your streams by calling the fs.close and sw.close methods
> --
> -iwdu15

i dont want that user will wirte that i want that program wirte by user
select ... i mean that the program will wirte the file for user he/she
just need to click on the button "wirte"
so
i just want the program will wirte
* some text *
to the filename.html file
thats possible ?
Author
2 Jul 2006 4:58 PM
Cor Ligthert [MVP]
Ailon,

Maybe this one can help you

http://www.vb-tips.com/default.aspx?ID=58514c5a-5f5d-4b6d-a7bd-da738cdc7c2c

I hope this helps,

Cor

<ailo***@gmail.com> schreef in bericht
Show quoteHide quote
news:1151857335.113057.306690@m79g2000cwm.googlegroups.com...
> well i want to edit simple html file :
> first i create it :
> system.io.file.create("C:\filename.html")
> what i shold do to edit it i mean i want to insert into it
> <html>
> <head>
> <title> TextTextText </title>
> </head>
> <body>
> TextBox1.Text
> </body>
> </html>
>
>
> how do i edit it ?
> tnx
>