2010-09-23 64 views

回答

2
string html = File.ReadAllText(@"C:\myhtmlfiles\index.html"); 

File.WriteAllText(@"c:\someotherfile.html", html); 
0
string readPath= "D:\\Read.html"; 
string writePath= "D:\\write.html"; 

StreamReader sr = new StreamReader(readPath); 
string html = sr.ReadToEnd(); 

StreamWriter sw = new StreamWriter(writePath); 
sw.WriteLine(html); 

string path = "D:\\Read.html"; 
string path1 = "D:\\write.html"; 

html=ReadAllText(path); 
File.WriteAllText(path1, html); 
0

當然,沒問題。 string foo = file.ReadToEnd()

相關問題