作者:VB.NET开发
项目:System.Deployment.Applicatio
Private Function CheckForFullTrust(ByVal appManifest As XmlReader) As Boolean
Dim isFullTrust As Boolean = False
If (appManifest Is Nothing) Then
Throw New ArgumentNullException("appManifest cannot be null.")
End If
Dim xaUnrestricted As XAttribute
xaUnrestricted = XDocument.Load(appManifest) _
.Element("{urn:schemas-microsoft-com:asm.v1}assembly") _
.Element("{urn:schemas-microsoft-com:asm.v2}trustInfo") _
.Element("{urn:schemas-microsoft-com:asm.v2}security") _
.Element("{urn:schemas-microsoft-com:asm.v2}applicationRequestMinimum") _
.Element("{urn:schemas-microsoft-com:asm.v2}PermissionSet") _
.Attribute("Unrestricted") ' Attributes never have a namespace
If xaUnrestricted Then
If xaUnrestricted.Value = "true" Then
Return True
End If
End If
Return False
End Function