Isolated Storage Space in Internet Permission Set

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
 
I

Ivan Medvedev [MS]

Jody -
yes, it is 10240 bytes for Internet by default. You can actually see it if
you look at the Internet named permission set in the security policy in the
".NET Framework Configuration" tool (from the control panel) or by running
"caspol -l" in the command line.
You can change that by creating a new permission set (or modifying the
existing Internet permission set), changing the quota value in the
IsolatedStorageFilePermission there and assigning it to the code group
corresponding to the Inernet zone. This can be done using the tools
mentioned above.
--Ivan
http://blogs.dotnetthis.com/ivan
http://www.dotnetthis.com
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top