📄 singlefile.aspx
字号:
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<Script language="VB" runat="server">
Public Sub Page_Load(sender As Object, e As EventArgs)
Dim dom As XmlDocument
Dim xsl As New XslTransform()
' Do we have the Wrox Pro ASP.NET book in the Cache?
If (IsNothing(Cache("1861004885.xml"))) Then
CacheStatus.Text = "Item not present, updating the Cache..."
UpdateCache("1861004885.xml")
Else
CacheStatus.Text = "Retrieving from Cache"
End If
' Load the transform
xsl.Load(Server.MapPath("book.xsl"))
dom = CType(Cache("1861004885.xml"), XmlDocument)
BookDisplay.Document = dom
BookDisplay.Transform = xsl
End Sub
Public Sub UpdateCache(strItem As String)
Dim strPath As String
Dim dom As New XmlDocument()
' Determine the file path the the file to monitor
strPath = Server.MapPath(strItem)
' Load the file into an Xml Dom
dom.Load(strPath)
' Create a CacheDependency on the file
Dim dependency as new CacheDependency(strPath)
' Cache the XML document
Cache.Insert(strItem, dom, dependency)
End Sub
</Script>
Status: <asp:label id="CacheStatus" runat=server/>
<br>
<asp:xml id="BookDisplay" runat=server/>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -