C# IOException: Sharing violation on path D:\files\ 出现这个错误一般是忘记关闭已经打开的文件,然后又打开一次。如果在些循环,打开文件的语句要写在循环外面。