作业帮 > 微软认证(MCSE) > 教育资讯

2013微软认证考试练习题及答案(6)[1]

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/09 14:46:38 微软认证(MCSE)
2013微软认证考试练习题及答案(6)[1]
2013微软认证考试练习题及答案(6)[1]微软认证(MCSE)
【网络综合 - 微软认证(MCSE)试题】
无忧考网为大家收集整理了《2013微软认证考试练习题及答案(6)》供大家参考,希望对大家有所帮助!!!

第 26 题
请使用下面的条件确定一个类型:
1) 是一个数字。
2) 不大于 65,535
请问,是哪一个类型?
A. System.UInt16
B. int
C. System.String
D. System.IntPtr
答案: A

第 27 题
你正在写用户验证和授权的代码。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

第 28 题
你正在为一个 Hong Kong 的客户开发一个应用。你需要为本地的货币显示一个符号。你应该使
用那段代码?
A. NumberFormatInfo culture = new CultureInfo("zh-HK").NumberFormat;
culture.NumberNegativePattern = 1; return numberToPrint.ToString("C", culture);
B. NumberFormatInfo culture = new CultureInfo("zh-HK").NumberFormat;
culture.CurrencyNegativePattern = 1; return numberToPrint.ToString("C", culture);
C. CultureInfo culture = new CultureInfo("zh-HK");return numberToPrint.ToString("-(0)",
culture);
D. CultureInfo culture = new CultureInfo("zh-HK"); return numberToPrint.ToString("()", culture);
答案:微软认证(MCSE)