J
Jody Gelowitz
Exactly what is the size limit of Isolated Storage in the Internet
permission set?
I have a document indicating it is 10MB
(http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/)
There is another document indicating it is 10240 in size
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht
ml/cpcondefaultsecuritypolicy.asp)
After running a test to create a directory and an empty file in Isolated
Storate under the Internet permission set, I have found the current size to
be 2048 (sample code at the bottom of this message). This would indicate
that the size is 10Kb in size.
Are my findings correct? If so, is there a way to increase the Isolated
Storage quota under the Internet permissions?
Thanks,
Jody
Sample Code
--------------
Private Sub DetermineCache()
Dim isoStore As IsolatedStorage.IsolatedStorageFile
Try
isoStore = IsolatedStorage.IsolatedStorageFile.GetUserStoreForDomain()
CreateDir("Test", isoStore)
MsgBox("Max size: " & isoStore.MaximumSize.ToString & ControlChars.CrLf & _
"Current size: " & isoStore.CurrentSize.ToString)
Catch ex As Exception
MsgBox(ex.ToString)
Finally
If Not isoStore Is Nothing Then
isoStore.Close()
isoStore.Dispose()
isoStore = Nothing
End If
End Try
End Sub
Private Function CreateFile(ByVal p_strIsoPath As String, ByVal p_isoStore
As IsolatedStorage.IsolatedStorageFile) As
IsolatedStorage.IsolatedStorageFileStream
Dim isoFile As IsolatedStorage.IsolatedStorageFileStream
Try
isoFile = New IsolatedStorage.IsolatedStorageFileStream(p_strIsoPath,
IO.FileMode.Create, IO.FileAccess.ReadWrite, p_isoStore)
Catch ex As Exception
MsgBox(ex.ToString)
Finally
End Try
Return isoFile
End Function
Private Function CreateDir(ByVal p_strPath As String, ByVal p_isoStore As
IsolatedStorage.IsolatedStorageFile) As Boolean
'checks if directory exists in isostorage, creates it if not
Dim bolReturn As Boolean
Dim astrDir() As String
Try
astrDir = p_isoStore.GetDirectoryNames(p_strPath)
If astrDir.Length = 0 Then
p_isoStore.CreateDirectory(p_strPath)
End If
bolReturn = True
Catch ex As Exception
bolReturn = False
End Try
Return bolReturn
End Function
permission set?
I have a document indicating it is 10MB
(http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/)
There is another document indicating it is 10240 in size
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht
ml/cpcondefaultsecuritypolicy.asp)
After running a test to create a directory and an empty file in Isolated
Storate under the Internet permission set, I have found the current size to
be 2048 (sample code at the bottom of this message). This would indicate
that the size is 10Kb in size.
Are my findings correct? If so, is there a way to increase the Isolated
Storage quota under the Internet permissions?
Thanks,
Jody
Sample Code
--------------
Private Sub DetermineCache()
Dim isoStore As IsolatedStorage.IsolatedStorageFile
Try
isoStore = IsolatedStorage.IsolatedStorageFile.GetUserStoreForDomain()
CreateDir("Test", isoStore)
MsgBox("Max size: " & isoStore.MaximumSize.ToString & ControlChars.CrLf & _
"Current size: " & isoStore.CurrentSize.ToString)
Catch ex As Exception
MsgBox(ex.ToString)
Finally
If Not isoStore Is Nothing Then
isoStore.Close()
isoStore.Dispose()
isoStore = Nothing
End If
End Try
End Sub
Private Function CreateFile(ByVal p_strIsoPath As String, ByVal p_isoStore
As IsolatedStorage.IsolatedStorageFile) As
IsolatedStorage.IsolatedStorageFileStream
Dim isoFile As IsolatedStorage.IsolatedStorageFileStream
Try
isoFile = New IsolatedStorage.IsolatedStorageFileStream(p_strIsoPath,
IO.FileMode.Create, IO.FileAccess.ReadWrite, p_isoStore)
Catch ex As Exception
MsgBox(ex.ToString)
Finally
End Try
Return isoFile
End Function
Private Function CreateDir(ByVal p_strPath As String, ByVal p_isoStore As
IsolatedStorage.IsolatedStorageFile) As Boolean
'checks if directory exists in isostorage, creates it if not
Dim bolReturn As Boolean
Dim astrDir() As String
Try
astrDir = p_isoStore.GetDirectoryNames(p_strPath)
If astrDir.Length = 0 Then
p_isoStore.CreateDirectory(p_strPath)
End If
bolReturn = True
Catch ex As Exception
bolReturn = False
End Try
Return bolReturn
End Function