单项选择题
You are developing a class library. Portions of your code need to access system environment variables.
You need to force a runtime SecurityException only when callers that are higher in the call stack do not have the necessary permissions.
Which call method should you use?()
A.set.Demand();
B.set.Assert();
C.set.PermitOnly();
D.set.Deny();
相关考题
-
单项选择题
You are developing a class library that will open the network socket connections to computers on the network. You will deploy the class library to the global assembly cache and grant it full trust. You write the following code to ensure usage of the socket connections. SocketPermission permission = new SocketPermission(PermissionState.Unrestricted); permission.Assert(); Some of the applications that use the class library might not have the necessary permissions to open the network socket connections.You need to cancel the assertion. Which code segment should you use?()
A.CodeAccessPermission.RevertAssert();
B.CodeAccessPermission.RevertDeny();
C.permission.Deny();
D.permission.PermitOnly(); -
多项选择题
你正在定义个一叫做Certkiller的类,这个类包含如下内容. Certkiller类包含一个可以再对象上执行的叫做ProcessChildren的方法。 Cerkiller类的对象可以被序列化()
A.Apply the OnDeserializing attribute to the ProcessChildren method.
B.Specify that Certkiller Class implements the IDeserializationCallback interface.
C.Specify that Certkiller Class inherits from the ObjectManager class.
D.Apply the OnSerialized attribute to the ProcessChildren method.
E.Create a GetObjectData method that calls ProcessChildren.
F.Create an OnDeserialization method that calls ProcessChildren. -
单项选择题
You are writing an application that uses isolated storage to store user preferences. The application uses multiple assemblies. Multiple users will use this application on the same computer.You need to create a directory named Preferences in the isolated storage area that is scoped to the current Microsoft Windows identity and assembly. Which code segment should you use?()
A.A
B.B
C.C
D.D
