そうすれば、アプリ起動時にnew FileStream(特定のファイル、FileShare.None) アプリ終了時にStream.Closeの2行で実装終了

Windows最強