You work as the application developer at Cert-Tech.com. Cert-Tech.com uses Visual Studio.Net 2005 as its application development platform. You use a Windows XP Professional client computer named Client01 as
your development computer.
You are developing a .Net Framework 2.0 application on Client01. You write the code shown below:
Public Class Shape
Private shapeName as String
Public Sub Shape(ByVal shapeName as String)
Me.shapename=shapeName
End Sub
Public Overridable Fuction GetName() As String
Return shapeName
End Function
Private Sub DrawShape()
'Additional code goes here
End Sub
End Class
You later decide to have the application compiled and registered for COM interoperability. The other developers on your team complaing that they are unable to create an instance of the Shape class in their COM applications. You are required to ensure that COM applications are able to create an instance of the Shape class.
What should you do?
You are developing an application that uses role-based security. The principal policy of the application domain is configured during startup with the following code:
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
You need to restrict access to one of the methods in your application so that only members of the local
Administrators group can call the method.
Which attribute should you place on the method?
You deploy several .NET-connected applications to a shared folder on your company network. Your applications require full trust to execute correctly. Users report that they receive security exceptions when they
attempt to run the applications on their computers. You need to ensure that the applications on the users computers run with full trust. What should you do?
You are developing an application that runs by using the credentials of the end user. Only users who are members of the Administrator group get permission to run the application. You write the following security code
to protect sensitive data within the application.
bool isAdmin=false;
WindowsBuiltInRole role=WindowsBuiltInRole.Administrator;
......
if(!isAdmin)
throw new Exception("User not permitted");
You need to add a code segment to this security code to ensure that the application throws an exception if a user is not a member of the Administrator group.
Which code segment should you use?
You work as aplication developer at Cer-Tech.com. You have recently created an aplication that includes the code shown below.
You now need to invoke the GetFileContents method asynchronously.
You have to ensure that the code you use to invoke the GetFileContents method will continue to process other user instructions, and displays the results as soon as the GetFileContents method finishes processing.
What should you do?
You work as an application developer. You are currently in the process of creating an application that reads binary information from a file.
You need to ensure that the only the first kilobyte of data is retrieved.
Vhat should you do?