0
我似乎無法找到一種方法來通過c#編寫整個HTML文件,我只能找到一行逐行寫入,但有沒有辦法一次添加它? 。對不起,我英文不好:(
這是我的時刻。寫完整的html文件
string path = @"c:\MyTest.html";
// This text is added only once to the file.
if (!File.Exists(path))
{
// Create a file to write to.
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(@"<script type="text/javascript/">");
}
}
但我怎麼可以把JavaScript和報價跡象一個字符串?它不想用引號和其他符號來做 –
這似乎是與寫入文件不同的問題,請考慮將它張貼爲一個新問題 – waldrumpus
好的,謝謝。 –