Partager via


IWMSCacheItem Object (Visual Basic .NET)

You can use the IWMSCacheItem object to retrieve information about cached content.

The IWMSCacheItem object exposes the following properties.

Property

Description

ContentSize

Retrieves the size of the content in bytes.

OriginURL

Retrieves the relative URL for the cached content.

Example

The following example illustrates how to retrieve an IWMSCacheItem object.

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub RetrieveObj()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Plugins As IWMSPlugins
    Dim CacheProxyPlugin As IWMSCacheProxyPlugin
    Dim CacheItems As IWMSCacheItems
    Dim CacheItem As IWMSCacheItem
    Dim i As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlugins object
    ' containing cache proxy plug-ins.
    Plugins = Server.CacheProxy

    ' Retrieve the IWMSCacheProxyPlugin object.
    CacheProxyPlugin = Plugins.Item(0)

    ' Retrieve the IWMSCacheItems object.
    CacheItems = CacheProxyPlugin.CacheItems

    ' Retrieve information on each cache item.
    For i = 0 To CacheItems.Count - 1
        CacheItem = CacheItems(i)
    Next i

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

See Also

Concepts

Server Object Model (Visual Basic .NET)