The file is being used by another process, so the process cannot access the file
The method used to construct system. Io. filestream is incorrect.
It is directly used at the beginning.
System. Io. filestream FS = new system. Io. filestream (filename, system. Io. filemode. open)
This method is used to open a file in read-only sharing mode. However, if the file has been opened by a process with write permission, it cannot be read,
Therefore, you need to use
System. Io. filestream FS = new system. Io. filestream (filename, system. Io. filemode. Open, system. Io. fileaccess. Read, fileshare. readwrite );
Set the file sharing mode to read and write, fileshare. readwrite. In this way, you can open
Website creation-website construction-company website-product sales website-product display website-enterprise publicity website-online shop-online mall-Information Classification Website-qq471226865