我们考吧网为了帮助考生朋友们加强基础知识的巩固,加强练习试题的训练,有效的提高学习效率,我们考吧网整理了一些关于微软认证模拟试题,希望对本次的考试有所帮助,汇编的模拟试题如下:同时也希望你本次顺利通关。想了解更多职称计算机咨询,就请继续关注我们考吧网。
1.你正在创建一个将被用于多个应用的、名为 Company1 的强类型程序集。Company1 在整个开发周期中会经常的重新编译。你需要保证,程序集在每次重新编译后使用它的应用都能正确的运行。为此,你将配置开发 Company1 的计算机,使每个应用都能使用 Company1 的最新编译版本。你应该通过下面哪两个步骤完成?(每个答案代表解决方案的一部分)
A. 创建一个指向强类型程序集编译输出目录的DEVPATH 环境变量,。
B. 在machine.config配置文件中增加:
C. 在machine.config配置文件中增加:
language="en-US" version="*.*.*.*" />
D. 为使用强类型程序集的每个应用的配置文件增加:
E. 为使用强类型程序集的每个应用的配置文件增加:
language="en-US" version="*.*.*.*" />
答案: A, B
2.你正在开发一个类库。你的代码需要访问系统环境变量。对于未给调用堆栈中处于较高位置的所有调用方授予当前实例所指定的权限,则在运行时强制 SecurityException。你应该调用那个方法?
A. set.Demand();
B. set.Assert();
C. set.PermitOnly();
D. set.Deny();
答案: A
3.你正在写用户验证和授权的代码。username, password, 和roles存储在你的应用数据存储区。你需要建立一个用于授权检查的用户安全上下文,例如IsInRole。你写如下的代码段去验证用户:
if (!TestPassword(userName, password))
throw new Exception("could not authenticate user");
String[] userRolesArray =LookupUserRoles(userName);
你需要完成这段代码从而为用户建立安全上下文。你应该使用那个代码段?
A. GenericIdentity ident = new GenericIdentity(userName);
GenericPrincipal currentUser = new GenericPrincipal(ident, userRolesArray);
Thread.CurrentPrincipal = currentUser;
B. WindowsIdentity ident = new WindowsIdentity(userName);WindowsPrincipal currentUser =
new WindowsPrincipal(ident);Thread.CurrentPrincipal = currentUser;
C. NTAccount userNTName = new NTAccount(userName);GenericIdentity ident = new
GenericIdentity(userNTName.Value);GenericPrincipal currentUser= new
GenericPrincipal(ident, userRolesArray);Thread.CurrentPrincipal = currentUser;
D. IntPtr token = IntPtr.Zero;token = LogonUserUsingInterop(username,
encryptedPassword);WindowsImpersonationContext ctx =
WindowsIdentity.Impersonate(token);
答案: A
4.你正在开发一个从应用目录动态的装入程序集的应用。你需要写一段代码去动态的装入Company1.dll 程序集到当前的应用执行域中。你应该使用下面那段代码?
A. AppDomain domain = AppDomain.CurrentDomain;string myPath =
Path.Combine(domain.BaseDirectory, "Company1.dll");
Assembly asm = Assembly.LoadFrom(myPath);
B. AppDomain domain = AppDomain.CurrentDomain;string myPath =
Path.Combine(domain.BaseDirectory,
"Company1.dll");Assembly asm = Assembly.Load(myPath);
C. AppDomain domain = AppDomain.CurrentDomain;string myPath =
Path.Combine(domain.DynamicDirectory, "Company1.dll");Assembly asm =
AppDomain.CurrentDomain.Load(myPath);
D. AppDomain domain = AppDomain.CurrentDomain;Assembly asm =
domain.GetData("Company1.dll");
答案: A
编辑推荐: