try
{
string templateFile = "C:/Oneview_MAT/template.html";
string temp1 = File.ReadAllText(templateFile);
string outputFile = @"C:\Oneview_MAT\output.txt";
foreach (var i in val)
{
string eachkey = i.Key;
string eachval = i.Value;
if (temp1.Contains(eachkey))
{
string value = "output_"+eachkey ;
temp1 =temp1.Replace(value, eachval);
//Console.WriteLine(data);
}
}
string temp2 = File.WriteAllText(outputFile,temp1);
}
What I have tried:
I have tried reading html file, changing its content and then writing it to another file.I am getting error in this line- string temp2 = File.WriteAllText(outputFile,temp1);