本文整理汇总了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)
开发者ID:VB.NET开发者,项目名称:System.IO.IsolatedStorage,代码行数:8,代码来源:IsolatedStorageFile.GetStore
示例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
开发者ID:VB.NET开发者,项目名称:System.IO.IsolatedStorage,代码行数:54,代码来源:IsolatedStorageFile.GetStore
注:本文中的System.IO.IsolatedStorage.IsolatedStorageFile.GetStore方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论