2010-02-06 68 views

回答

10

這段C#.NET代碼片段如何?

FileInfo fi = new FileInfo("filename"); 
FileStream fs = fi.Open(FileMode.Open); 

long bytesToDelete = 5000; 
fs.SetLength (Math.Max(0, fi.Length - bytesToDelete)); 

fs.Close(); 
+0

謝謝,沒想到 – 2010-02-06 21:08:20

+0

很好的答案的 – 2015-02-10 18:51:41

相關問題