本文整理汇总了VB.NET中System.IO.IsolatedStorage.IsolatedStorageFile.GetStore方法的典型用法代码示例。如果您正苦于以下问题:VB.NET IsolatedStorageFile.GetStore方法的具体用法?VB.NET IsolatedStorageFile.GetStore怎么用?VB.NET IsolatedStorageFile.GetStore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.IsolatedStorage.IsolatedStorageFile
的用法示例。
在下文中一共展示了IsolatedStorageFile.GetStore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: IsolatedStorageFileStream
' Retrieve an IsolatedStorageFile for the current Domain and Assembly.
Dim isoFile As IsolatedStorageFile = _
IsolatedStorageFile.GetStore(IsolatedStorageScope.User _
Or IsolatedStorageScope.Assembly _
Or IsolatedStorageScope.Domain, Nothing, Nothing)
Dim isoStream As New IsolatedStorageFileStream("substituteUsername", System.IO.FileMode.Open, _
System.IO.FileAccess.Read, System.IO.FileShare.Read)
示例2: Program
' 导入命名空间
Imports System.IO
Imports System.IO.IsolatedStorage
Imports System.Security
Imports System.Security.Policy
Imports System.Security.Permissions
Imports System.Security.Cryptography.X509Certificates
Class Program
Public Shared Sub Main(ByVal args() As String)
Try
If Test Then
Console.WriteLine("PASSED.")
Environment.ExitCode = 100
Else
Console.WriteLine("FAILED.")
Environment.ExitCode = 101
End If
Catch e As Exception
Console.Write("Exception occurred: {0}", e.ToString)
Environment.ExitCode = 101
End Try
Return
End Sub
Public Shared Function Test() As Boolean
Dim bRes As Boolean = True
Dim evidence1 As Evidence = GetTestEvidence
Dim evidence2 As Evidence = GetTestEvidence
Dim isf As IsolatedStorageFile = IsolatedStorageFile.GetStore((IsolatedStorageScope.User _
Or IsolatedStorageScope.Assembly), _
evidence1, _
GetType(System.Security.Policy.Publisher), _
evidence2, _
GetType(System.Security.Policy.Publisher))
Dim isfs As IsolatedStorageFileStream = New IsolatedStorageFileStream("AdminEvd1.testfile", _
FileMode.OpenOrCreate, isf)
isfs.WriteByte(5)
isfs.Flush()
isfs.Close()
Return bRes
End Function
Public Shared Function GetTestEvidence() As Evidence
' For demonsration purposes, use a blank certificate.
Dim CertTemp(63) As Byte
Dim pub As Publisher = New Publisher(New X509Certificate(CertTemp))
Dim arrObj(0) As Object
arrObj(0) = CType(pub, Object)
Return New Evidence(arrObj, arrObj)
End Function
End Class