请注意:我希望刷新某个站点下所有虚拟目录,而不是只刷新一个虚拟目录下的Application变量,谢谢!

解决方案 »

  1.   

    只能通过程序控制IIS自动重新启动!
      

  2.   

    <script runat=server>
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) 
            Me.Response.RemoveOutputCacheItem("http://tt/mms/ascx_DPIC.ascx")
            On Error Resume Next
            Me.Response.Write("所有缓存数目:" & Me.Cache.Count & "<br>")
            Me.Response.Write("所有Application数目:" & Me.Page.Application.Count & "<br>")        Dim Enum1 As IEnumerator
            Enum1 = Me.Cache.GetEnumerator
            While Enum1.MoveNext
                Dim  S as string =Enum1.Current.key
                Response.Write("Cache:" & S & "  Type:" & Me.Cache(S).GetType.ToString() & "<br>")
            End While        Dim Enum2 As IEnumerator        Enum2 =Me.Application.GetEnumerator()
            While Enum2.MoveNext
                Dim S as string =Enum2.Current
                Response.Write("App:" & S & "Value:" & Me.Application(S) & "<br>")
     
            End While
        End Sub</script>