Hey, I have a function that replaces a string within a file:
public static void WebPage(int gradeA, int gradeB, int gradeC, int gradeD, int gradeE, int gradeF)
{
// read the HTML file
TextReader webpage = new StreamReader ("/Users/Desktop/Assignment/webpage.html");
string LookUp;
while ((LookUp = webpage.ReadLine()) != null)
{
string replace = "var grade1 = \"\"";
string replaceWITH = "var grade1 = \"" + gradeA + "\"";
string str = LookUp.Replace (replace, replaceWITH);
}
}
But it doesn't write to the file? But it will display on console window? I have tried to include the TextWriter function but it will just clear the whole HTML.
Any ideas?