PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are developing a component by using the .NET Framework 3.5.
The component will be distributed with a Windows Forms application.
The component provides a method named PrintPayroll. The method is used to print payroll information to a dedicated printer without the intervention of the user.
The component will be installed with full trust on the computer of the user.
The component is occasionally called by the applications by using restricted permissions.
You need to ensure that the component can print without granting additional permissions to the calling application.
Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
PrintingPermission pPermission = new PrintingPermission(PrintingPermissionLevel.SafePrinting);
pPermission.Demand();
PrintPayRoll();

B.
PrintingPermission pPermission = new PrintingPermission(PrintingPermissionLevel.SafePrinting);
pPermission.Assert();
PrintPayRoll();

C.
PrintingPermission pPermission = new PrintingPermission(PrintingPermissionLevel.DefaultPrinting);
pPermission.Demand();
PrintPayRoll();

D.
PrintingPermission pPermission = new PrintingPermission(PrintingPermissionLevel.DefaultPrinting);
pPermission.Assert();
PrintPayRoll();


Leave a Reply