To see how the word, enter the Code below in the file "Global.asax.cs" The Events Application_Start () and using System.Reflection with the work it off as soon as the Application Directory Monitoring starts.
System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
object o = p.GetValue(null, null);
System.Reflection.FieldInfo f = o.GetType().GetField("_dirMonSubdirs", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.IgnoreCase);
object monitor = f.GetValue(o);
System.Reflection.MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
m.Invoke(monitor, new object[] { });
For those who are not used. Global.asax.cs. I explain a little offline.
Global.asax.cs file is a file called Global.asax Inherits come Again. Both files must be on top of the site only, I will. It describes the more "simple" Download to no better than this, I put the Code on the already offline.
Click here to download the Global.asax and Global.asax.cs.
When we put the Code, if the case already about this Error.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Go to the web.config file to add the Code below.
<system.web>
<trust level="Full" originUrl=""/>
</system.web>
No comments:
Post a Comment