Write and Read a file html

G

Guest

I have a file Reportcontrolli.html...I must read it...find and replace a word...and write in another file Reportcontrolli1.htm
My following code don't write

Public Function ScriviTesto(ByVal testo As String
Dim s As Strin
Dim MyFileRead As FileStrea
MyFileRead = New FileStream(m_PathFiles + "Reportcontrolli.html", FileMode.Open, FileAccess.Read
Dim textFile As New StreamReader(MyFileRead
s = textFile.ReadToEn
s = s.Replace("*RIFCOMPLETI*", testo)
MyFileRead.Close(
Dim Myfilewrite As FileStrea
Myfilewrite = New FileStream("c:\Reportcontrollicopia.html", FileMode.Create, FileAccess.Write
Dim writeFile As New StreamWriter(MyFilewrite
MyFilewrite.Write(s
Myfilewrite.Close(

In the string 's' there is the correct html with a word already replaced......so the read is good but the file html created is empty

Can you help me

Thank yo
cos75
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top