Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal context As String, _ ByVal itemExpireDuration As TimeSpan, _ ByVal bytesLimit As Long, _ ByVal storageDirectory As String, _ ByVal encryptData As Boolean _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim context As String Dim itemExpireDuration As TimeSpan Dim bytesLimit As Long Dim storageDirectory As String Dim encryptData As Boolean Dim instance As New Cache(context, itemExpireDuration, bytesLimit, storageDirectory, encryptData) |
C# | |
---|---|
public Cache( string context, TimeSpan itemExpireDuration, long bytesLimit, string storageDirectory, bool encryptData ) |
C++/CLI | |
---|---|
public: Cache( String^ context, TimeSpan itemExpireDuration, int64 bytesLimit, String^ storageDirectory, bool encryptData ) |
Parameters
- context
- A System.String which identifies the cache context, each user using the cache should have its own context.
- itemExpireDuration
- A System.TimeSpan value which specify how long an item remains in the cache.
- bytesLimit
- The cache maximum size in bytes.
- storageDirectory
- The physical directory path where cache items will be stored.
- encryptData
- true to encrypt the cache items added to this cache object; otherwise false.
This constructor uses the machine physical disk to store and retrieve cache information. The cache contents will be protected and encrypted so only the same user context who stored the cache item can retrieve and view the cached items.
If you don't want the cache information to be encrypted, set the encryptData to false.
Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family