Write and Read a file html

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Back
Top