本來拿寫修改記錄檔用的
1 |
<span style="color: #606060" id="lnum1"> 1:</span> StreamWriter sw = File.AppendText(filepath); <span style="color: #008000">//AppendText 使用附加方式</span> |
1 |
<span style="color: #606060" id="lnum2"> 2:</span> sw.WriteLine(<span style="color: #006080">"line 1 : "</span>+Time.Now.ToString(<span style="color: #006080">"yyyy/MM/dd hh:mm:ss"</span>)); |
1 |
<span style="color: #606060" id="lnum3"> 3:</span> sw.WriteLine(<span style="color: #006080">"line 2 : "</span>+Time.Now.ToString(<span style="color: #006080">"yyyy/MM/dd hh:mm:ss"</span>)); |
1 |
<span style="color: #606060" id="lnum4"> 4:</span> sw.Flush(); |
1 |
<span style="color: #606060" id="lnum5"> 5:</span> sw.Close(); |
(Visited 21 times, 1 visits today)