Hi,
My requirement is as follows:
I need to set the HttpExpires (enable content expiration - set to 7 days) on
a folder within a virtual directory.
I have been able to set the HttpExpires property on a virtual directory
using the following code:
DirectoryEntry myVdPath = new
DirectoryEntry( "IIS://localhost/W3SVC/1/Root/<virtual directory>");
myVdPath.Refres hCache();
myVdPath.Proper ties["HttpExpire s"].Value = "D, 604800"; //Content expiration
after 7 days
myVdPath.Commit Changes();
But, if I modify the path and use "IIS://localhost/W3SVC/1/Root/<virtual
directory>/<directory on which the property is to be set>", then it throws
the following exception:
An unhandled exception of type 'System.Runtime .InteropService s.COMException'
occurred in system.director yservices.dll
Additional information: The system cannot find the path specified
Regards,
Shailesh Patel