私のコードでC:\ Windows \ System32 \ winevtディレクトリにアクセスしようとしていますが、System.IO.DirectoryNotFoundException
があります。C#でwinevtディレクトリにアクセスするとDirectoryNotFoundExceptionがスローされる
私はこのスレッドを読んで: Anyone know why I can't access the winevt folder programmatically in C#?
これはSystemWOW64ディレクトリに64ビットオペレーティングシステムで32ビットアプリケーションを実行すると、再度指示することを私に意味し、解像度が代わりに設定することです私のディレクトリ%windir%\Sysnative\winevt
に。だから私は上記のスレッドで提供されている答えに合致するようにコードを修正しましたが、まだ失敗します。私は実行中ですwindows 10 enterprise 64-bitとSysnativeは存在しません。
コード例:
string directory = @"C:\Windows\System32";
bool isDirectoryExists = Directory.Exists(directory);
これはfalseを返します:
これはtrueを返します
string directory = @"C:\Windows\System32\winevt";
bool isDirectoryExists = Directory.Exists(directory);
は、ディレクトリシステムとSYSWOW64にはwinevtディレクトリはありません、とシスネラティブは存在しません。だから私の質問は、どのように私はwinevtディレクトリにアクセスできますか?