a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 251|回复: 1

[考试试题] 2012年微软认证考试模拟试题及答案12

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
第 56 题  : z- Y0 J2 v& f4 C% b" U( x
你正在为一个客户开发一个财务报表。你的客户在美国有总部,在密西哥有分部。你需要保  
5 y1 B- `; X, g" ^, `6 _# s; @证客户在密西哥产生的报表,则当前的日期格式为 Mexican  Spanish 格式。你应该使用下面  
( w" N2 O- f' r+ c, \1 U那个代码段实现?  - t# O( S  B3 q
A. DateTimeFormatInfo dtfi = new CultureInfo("es-MX", false).DateTimeFormat;  
2 c4 @$ I, ?% c# QDateTime dt = new DateTime(DateTime.Today.Year, DateTime.Today.Month,  
" X& K( X/ g1 u$ P6 d  qDateTime.Today.Day); string dateString = dt.ToString(dtfi.LongDatePattern);  
5 X* o& k% B8 d! n$ TB. Calendar cal = new CultureInfo("es-MX", false).Calendar; DateTime dt = new  8 e, Q+ |1 P7 |! N
DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day); Strong  : K4 ]- X  u- @! J1 u% I
DateString = dt.ToString();  - I: N- \0 t" o$ S% x1 Z, a
C. string dateString = DateTimeFormatInfo.CurrentInfo  4 g8 U6 t' y  s8 \7 s! [2 P. E
GetMonthName(DateTime.Today.Month);  - O% C) s3 O$ O  ~) g0 q
D.string dateString = DateTime.Today.Month.ToString("es-MX");  
4 [. \- E; p! f  e& N答案: A  : e7 b3 B9 T7 Z! f
  + |3 l) f" F2 e- G9 a2 R+ F" K
第 57 题  ) P  T6 G* b, Q+ L  Y0 _& ^
你正在创建一个应用,它从应用配置文件的自定义节中读取值。XML 自定义节如下:  ! G( Q$ k# _+ f) C- I( g
  
4 _3 ]* O. z9 z2 W! [8 w( m$ b  5 }2 k* u( J$ p3 b/ t' I: J4 l
  ) S; n! t  N4 a4 q9 V' q; O
  # F) Y; ~4 h7 i+ L7 K/ D0 \
  7 r, n( Y4 t' O$ n. J& b
你需要写一个代码段去定义一个名为Role  的类。而且你需要保证Role类使用从配置文件自定义  $ N; _: W, ?  u  l
节读取的数据进行初始化。你应该使用下面那个代码段?  
1 H' B9 p& K8 d2 E1 AA.   public class Role : ConfigurationElement  
: L  d. W: W2 M, ~. O' f; l! g{  / K7 P+ m- e: {% I; r/ O3 }
internal string_ElementName = "name";  . o# m; Q: `1 z' W2 B
[ConfigurationProperty("role")]  
9 _. q0 u* y8 M6 ?public string Name  ! F; i- M$ L0 R0 W
{  % W) o9 {+ ?- |* p
get  + h& s/ ~( @; M4 v% g! o
{  
& J" T  `( J. i* G& D% B, _: Dreturn ((string)base["role"]);  0 |9 h2 q/ \% k. _: f) D
}  ' M* R+ ]# D& b5 J/ G/ o' y, O$ h" s
}  
, k) }% S. e0 s6 \}  
  d6 n2 Y6 g, b# @, k# A. T. bB. public class Role : ConfigurationElement {  
( t6 A' S) Q5 einternal string_ElementName = "role";  7 ^# T/ d4 H+ b* f3 h, d2 V" S
[ConfigurationProperty("name", RequiredValue = true)]  - D' q* ]% }9 k2 G6 m5 x9 i$ s" Y3 T, _5 I
public string Name {  
) J  }: J. r3 }, Uget {  
2 ~7 M! `+ S; e* J# P. O( |return ((string)base["name"]);  9 d  M2 g. W; D  C5 R1 K4 m
}  
2 t8 e  C' n5 q" R}  
( b+ @( D$ t4 w}  - p- G- f% f$ U1 i
C. public class Role : ConfigurationElement {  
5 |9 X+ K( S8 l. W$ L1 w& {: xinternal string_ElementName = "role";  
. H7 V9 q5 ^6 S6 q1 f, l, |) Kprivate String_name;  
5 `7 u( |8 n( Y% ~$ a[ConfigurationProperty("name")]  
5 B* o; ]7 A- F4 q: n, b2 Jpublic string Name {  
  Q9 d/ V0 a$ V" e; Aget {  
0 e: C9 V4 t2 \7 i  lreturn_name;  3 J. }8 A0 ^5 ?
}  8 a: G' O" t4 f, O
}  4 H+ S% l& I; T  \4 s. s8 u
}  : s+ p4 S3 g" j& F
D. public class Role : ConfigurationElement {  1 N+ r2 o& ]3 e) g6 g8 l/ A
internal string_ElementName = "name";  
( W4 c5 E) B4 Q0 h% Q* ]" ?6 mprivate String_name;  
8 X! k- d% z( F# b, E& `4 Y2 Y: D[ConfigurationProperty("role", RequiredValue = true)]  
5 n. `3 ~; J% q* f3 l- z# ppublic string Name {  
8 H3 Z& {3 x, uget {  
/ r2 W- U( e2 qreturn_name;  5 i4 i9 ?0 z2 q& B
}  
3 h, T$ e! q4 T) T) A/ `0 S}  4 G8 T( a1 c5 I. u, S6 E
}  
0 f7 [. a" _. ^$ c+ E" E答案: B  
8 Z3 E7 w- ]: f' o  s
) C7 }5 o5 k- W
% S) B; `2 O! ~+ }3 Q7 j# \! I) I第 58 题  
8 g5 A- z4 ~  e' W' D3 t你需要从你的托管代码使用平台调用服务(platform invoke services)调用一个非托管的函数,  
, B# h% J; K& b& K+ }+ k: _你应该怎么做?  ( O1 h4 f; v  E- K: r0 Z2 w. j
A. Create a class to hold DLL functions and then create prototype methods by using managed  7 @% f" Z$ c# e( v1 O$ V
Code。  / y- `6 Z0 |, B
B.  注册你的程序集为COM组件然后从COM中引用你的托管代码。  
5 [# N- A* r; D8 |8 e; K, z8 bC.  为你的托管代码导出类型库。  
& Z/ O6 m9 n+ r8 c( f) h0 vD.导入类型库作为一个程序集然后创建COM对象实例。   5 D- ?% Y. O1 q0 G
答案: A
回复

使用道具 举报

 楼主| 发表于 2012-8-3 00:09:23 | 显示全部楼层

2012年微软认证考试模拟试题及答案12

</p>第 59 题  
# M) o# G- p5 O; a! H) _! H! P% O你正在使用 Microsoft Visual Studio 2005 IDE 去检查一个返回字符串的方法。你指定方法的返  ! h$ _5 ~1 W7 q4 f& _
回值保存到字符串变量  fName 中。你需要写一个代码段,如果  fName 的值不等于"Company"  
, w1 B. @( R) D# J$ L4 @; l0 r6 F则打印如下的单行文本消息"Test  Failed:"fName。你也同时需要保证,你的代码段并不影响  % V0 b4 s# c" b5 \2 |
或打断应用的执行。你应该使用下面那个代码段?  
3 o9 [) l4 @; A! B6 A" ]A. Debug.Assert(fName == "Company", "Test Failed: ", fName);  
3 \: M  o7 r+ Z+ ~; d2 f7 DB. Debug.WriteLineIf(fName != "Company", fName, "Test Failed");  
, S9 u8 l6 N5 h0 Y3 J3 tC. if (fName != "Company") {  * s0 ~7 v! f8 D! o+ v
Debug.Print("Test Failed: ");  0 P5 \( [' T1 A! I  ~- J0 W
Debug.Print(fName);  
6 {. M' {. y' z) X6 l5 A- Q8 r}  % E; ~! l. p# j7 X5 l
D. if (fName != "Company") {  
0 ^( e" t3 o$ J: B! o6 a+ F/ BDebug.WriteLine("Test Failed: ");  7 U" F: D& B$ T- m8 b/ d8 Q
Debug.WriteLine(fName);  
4 t: q. m6 T% i1 t, D}  
1 M* V% J/ q3 z; Q答案: B  6 h# C" B' l1 O; g/ @
  
0 M$ t1 Y& `  u( [第 60 题  & r) E- g4 v. U3 w1 X6 N" _3 [
你正在开发一个使用自定义身份验证和基于角色安全的应用。你需要写一段代码在运行时为  
& y. Y" k3 g5 \  ?每一个线程指定一个未经过身份验证的标识对象。你可以使用下面那个代码段?  
# m+ T8 g, K# {A. AppDomain domain =  4 d/ S3 H! f" A6 F+ N4 r
AppDomain.CurrentDomain;domain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);  
7 w: ?# Z! s3 {; u4 \# XB. AppDomain domain = AppDomain.CurrentDomain;domain.SetThreadPrincipal(new  
3 Q( R0 y! C* C4 U$ z0 j' h" A- f& zWindowsPrincipal(null));  8 I' U$ }# N  L0 m. w" d
C. AppDomain domain = AppDomain.CurrentDomain;  
8 s9 L0 @7 ]1 E- M2 r* Kdomain.SetAppDomainPolicy(  & @/ N& N6 _( _5 g
PolicyLevel.CreateAppDomainLevel());  
. Z9 i! T: q' `, W( j# y, D1 vD. AppDomain domain = AppDomain.CurrentDomain;domain.SetPrincipalPolicy(  
+ R  V- v. J" I" c( V1 V* K5 w) {6 ZPrincipalPolicy.UnauthenticatedPrincipal);   . e2 Z  ^% R$ X2 n
答案: D
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-4-29 10:48 , Processed in 0.195773 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表