Question:An administrator runs the following Console application on a computer running Windows XP with the Everything permission set. What is the output from the application?

<Assembly: UIPermission(SecurityAction.RequestOptional, _
Unrestricted:=True)>
<Assembly: FileIOPermissionAttribute(SecurityAction.RequestOptional, _
Read:="C:\")>
<Assembly: FileIOPermissionAttribute(SecurityAction.RequestRefuse, _
Read:="C:\Windows\")>
Module Module1
Sub Main()
Console.WriteLine("Reading one line of the boot.ini file:")
Dim sr As StreamReader = New StreamReader("C:\boot.ini")
Console.WriteLine("First line of boot.ini: " + sr.ReadLine)
End Sub
End Module 

A Unhandled Exception: System.Security.SecurityException: Request for the
permission of type 'System.Security.Permissions.
FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed. 

B Reading one line of the boot.ini file:
Unhandled Exception: System.Security.SecurityException: Request for the
permission of type 'System.Security.Permissions.
FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed. 

C Reading one line of the boot.ini file:
First line of boot.ini: [boot loader] 

D An unhandled SecurityException occurs before the application begins execution. 

+ Answer
+ Report
Total Preview: 1117

Copyright © 2024. Powered by Intellect Software Ltd