Tem directories could be any directories within the file system and don't
have any special attribute. You can simulate what the Win32 function
GetTempPath does as follows:
string GetTempPath()
{
string res = Environment.GetEnvironmentVariable("TMP");
if ( res == null )
{
res = Environment.GetEnvironmentVariable("TEMP");
if ( res == null)
{
res = Environment. CurrentDirectory;
}
}
return res;
}
You can find also many other directories that you may want to ignore (like
cookies, temporary internet, application data, etc. ) using
Environment.GetFolderPath You must take into account that all those methods
return the desired directories for the current logged on user.
Hope this help,
Idael
..
"Heath" <he***@callbacksfa.com> wrote in message
news:a5*************************@posting.google.co m...
I'm dealing with a C# application that monitors changes to the file
system, and need to exclude irrelevent directories, temp directories
for example.
Is there any way to identify such directories, perhaps through
DirectoryInfo or something similar that might give some attribute that
temp, system, hidden, etc directories might be tagged with?
I wanted to write this code to check and ignore such directories
dynamically based on attriebutes, rather than find all the locations
that windows seems to put temp file and hard code exclusions.
Any help would be much appreciated.