StreamWriter sw=new St"> StreamWriter sw=new St">
将下列事件程序补充完整,使得程序运行后,单击button1按钮,把磁盘文件d:\test1.txt的内容添加到磁盘文件d:\test2.txt 的后面。
private void button1_Click(object sender,EventArgs e)
{
string line;
StreamReader sr=new StreamReader("d:\\test1.txt", true);
StreamWriter sw=new St
将下列事件程序补充完整,使得程序运行后,单击button1按钮,把磁盘文件d:\test1.txt的内容添加到磁盘文件d:\test2.txt 的后面。
private void button1_Click(object sender,EventArgs e)
{
string line;
StreamReader sr=new StreamReader("d:\\test1.txt", true);
StreamWriter sw=new StreamWriter( "d:\\test2.txt",(1));
while((line=sr.(2)())!=null)
sw.(3)(line);
sr.Close();
sw.Close();
}
【正确答案】:(1)true
(2)ReadLine
(3)WriteLine
Top