You are creating an XML Web service named myService. This service has a function named WriteMessage that writes messages to a flat file in the C:\myServiceLog directory. You want to implement security for WriteMessage so that WriteMessage and all the code it calls can write messages only to the myServiceLog directory. Which code segment should you use?
A.
FileIOPermission filePermission = new FileIOPermission
(FileIOPermissionAccess.Write, “C:\\myServiceLog”);
filePermission.Demand();
B.
FileIOPermission filePermission = new FileIOPermission
(FileIOPermissionAccess.Write, “C:\\myServiceLog”);
filePermission.Deny();
C.
FileIOPermission filePermission = new FileIOPermission
(FileIOPermissionAccess.Write, “C:\\myServiceLog”);
filePermission.PermitOnly();
D.
FileIOPermission filePermission = new FileIOPermission
(FileIOPermissionAccess.Write, “C:\\myServiceLog”);
filePermission.Assert();