What is the purpose of the PermissionSet attribute in the MSDN FileSystemWatcher class example?
问题 On the MSDN FileSystemWatcher Class page, it includes an example with the following class attribute: [PermissionSet(SecurityAction.Demand, Name="FullTrust")] What is the purpose of this? When should it be included or not included? The FileSystemWatcher Class help page is here: http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx 回答1: The FileSystemWatcher class has a link demand for unrestricted CAS permissions. This means that it will verify that its direct caller (i.e.