Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は、画像を扱う 1 つのアプリケーションに取り組んでいます。
バイト配列から新しいイメージを作成するコードがあります。
古いファイル名と同じ名前の新しい画像を作成するとき。
古いファイルを削除しようとします
ファイルが使用中で、アクセスが拒否されたという例外が発生します。
そのイメージを保持しているプロセスと、それを解放する方法がわかりません。
助けてください.....そのファイルを削除しています。
Use following code, if you are not using it the same way.
using( FileStream stream = new FileStream( path, FileMode.Open, FileAccess.Read ) ) { image = Image.FromStream( stream ); }
Posting your own code, would help though!