The path to a file or directory that the cached object is dependent upon. When this resource changes, the cached object becomes obsolete and is removed from the cache.
If the directory or file specified in the fileName parameter is not found in the file system, it will be treated as a missing file. If the file is created after the object with the dependency is added to the , the cached object will be removed from the .
For example, assume that you add an object to the with a dependency on the following file path: c:\stocks\xyz.dat. If that file is not found when the CacheDependency object is created, but is created later, the cached object is removed upon the creation of the xyz.dat file.
The following example demonstrates code that creates an instance of the CacheDependency class when an item is inserted in the with a dependency on an XML file.
// Make key1 dependent on a file.
The time when change tracking begins.
The following example demonstrates code that creates an instance of the CacheDependency class when an item is inserted in the with a dependency on an XML file. The tracking start time is set to 10 minutes in the future.
An array of file paths (to files or directories) that the cached object is dependent upon. When any of these resources change, the cached object becomes obsolete and is removed from the cache.
If any of the files or directories in the array were to change or be removed from the array, the cached item becomes obsolete and is removed from the application's object.
Also, if any of the directories or files specified in the fileNames parameter is not found in the file system, they are treated as missing files. If any of them are created after the object with the dependency is added to the , the cached object will be removed from the .For example, assume that you add an object to the with a dependency on the following file path: c:\stocks\xyz.dat. If that file is not found when the CacheDependency object is created, but is created later, the cached object is removed upon the creation of the xyz.dat file.
fileNames contains a null reference (Nothing in Visual Basic).
An array of cache keys that the new object monitors for changes. When any of these cache keys change, the cached object associated with this dependency object becomes obsolete and is removed from the cache.
The following code fragment demonstrates how to insert an item into your application's with a dependency on a key to another item placed in the cache. Since this method uses array syntax, you must define the number of keys the item you are adding to the is dependent on.
fileNames or cacheKeys contains a null reference (Nothing in Visual Basic).
Another instance of the CacheDependency class that this instance is dependent upon.