a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 213|回复: 1

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

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
第 11 题  
5 U$ Q7 \6 @% J' z/ s% m你写了如下一段代码  public delegate void FaxDocs(object sender, FaxArgs args);  & y. q- J. |+ r
你需要创建一个调用FaxDocs的事件,你应该使用那个代码段?   ( i5 v8 E- e9 {
A. pulic static event FaxDocs Fax;  + T5 m' O* Z' H1 N
B. public static event Fax FaxDocs;  
; s& Q( q6 R3 V  R  x- X5 zC. public class FaxArgs : EventArgs {  5 ^# z/ |' o$ c
private string coverPageInfo;  
( L4 r1 A+ z' n5 lpublic FaxArgs(string coverInfo) {  1 w" Z* `0 h9 l  u
this.coverPageInfo = coverPageInfo;  
" w% J: O( E$ \0 X! `$ o$ J7 t}  
$ ]4 X8 T8 o/ G. C$ S' i/ Spublic string CoverPageInformation {    I# F/ T0 X! P, S# \2 q9 I
get {return this.coverPageInfo;}  
; y1 h4 h: E/ b. c! V- a9 m}}  ; g! W3 g- r  v% c) M' f% w# ^
D. public class FaxArgs : EventArgs {  ! z: [$ U4 V* j. B- J: }+ |  E
private string coverPageInfo;  
+ u* `6 o% x5 S+ W1 y2 ?. Kpublic string CoverPageInformation {  4 e2 a  z5 _9 V
get {return this.coverPageInfo;}  - e1 |. v1 E$ w* M! L  ~- K9 b
}}  ! t1 q; t; }- ?2 z6 a
答案: A  ) o  h& F' {8 Q3 A4 ~5 A! R
  ' {% k5 U/ I% t/ S( \0 z
第 12 题   
1 |1 k; H- b* S+ ?' g你写如下的代码段去调用Win32 Application Programming Interface (API):  : p' P, |( F; e1 \' }) r
string personName = "N?el";  
* n; }$ ^+ L9 Gstring msg = "Welcome" + personName + "to club"!";  - X( G* j! C: P* _6 p" o
bool rc =User32API.MessageBox(0, msg, personName, 0);  
, W! u0 w3 j9 X4 r  y为了实现上面的调用,你需要定义一个方法原型,请问,你会采用那个代码段进行定义?  5 S# [+ y2 P+ s& n6 t4 O" ?5 \6 _+ g7 m
A.   [DllImport("user32", CharSet = CharSet.Ansi)]  
% k  k" e+ L9 K$ Z6 C9 Lpublic static extern bool MessageBox(int hWnd,String text,String caption,uint type);}  
( _# J6 f. X& d* p- r1 q  EB.   [DllImport("user32", EntryPoint = "MessageBoxA", CharSet = CharSet.Ansi)]  
2 P0 f4 r& d3 O* Y. j0 j/ Y( UPublic static extern bool MessageBox(int hWnd,  
7 f& w' v/ h+ u8 A. ~[MarshalAs(UnmanagedType.LPWStr)]String text,  
+ p& t+ g/ @1 z6 u8 F4 t: }[MarshalAs(UnmanagedType.LPWStr)]String caption,  " N# h9 _" ?  D# g3 ~8 I! j' R1 O
uint type);}  ( j2 W& G# K; p. Q) G' x, S
C.   [DllImport("user32", CharSet = CharSet.Unicode)]  3 O7 C+ M5 z& _: d. V
public static extern bool MessageBox(int hWnd,String text, String caption,uint type);}  : X3 R- n5 I5 U3 ]7 H- V
D. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet =  7 X  N+ I$ q$ b& R
CharSet.Unicode)]public static extern bool MessageBox(int hWnd,  
9 o7 ]. B& {7 P! {' U/ _% I[MarshalAs(UnmanagedType.LPWStr)]String text,  / A( q& o$ ~8 e
[MarshalAs(UnmanagedType.LPWStr)]String caption,uint type);}  6 ?$ f% H  E4 v- I0 Z
答案:C  $ y  a+ C1 c" R6 T: Y

! p9 W8 r6 N$ N- P$ n' D  j/ M1 T第 13 题   & W$ [/ d0 I7 B# N3 ?0 w9 ^! t
你需要以字符串的形式返回isolated storage文件内容。已知,文件名称为Settings.dat并且在机  
$ ~# H& ]9 `! F* d/ |" K9 J器范围内唯一。你应该使用下面那个代码段?  
: n1 U4 X. l( H+ m6 O. d6 dA. IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream(  ) |5 u8 \" \# \3 w6 h& {7 w
"Settings.dat", FileMode.Open); string result = new StreamReader(isoStream).ReadToEnd();  
6 j. W9 J; S! N3 L* D3 o9 h. R! m* |B. IsolatedStorageFile isoFile;isoFile = IsolatedStorageFile.GetMachineStoreForAssembly();  
* g) z) m1 u* B4 [% yIsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream(  
* @6 |7 v' c7 z( A# W# f% e"Settings.dat", FileMode.Open, isoFile); string result = new  
8 v( F! P; h7 E2 M7 k- ^StreamReader(isoStream).ReadToEnd();  , ^" _) ?9 ]4 K1 h( o& D, K
C. IsolatedStorageFileStream isoStream;isoStream = new  " `2 N! D5 _2 v4 f3 i1 ^% f
IsolatedStorageFileStream("Settings.dat", FileMode.Open); string result =    F* {0 U" e$ m3 d% c7 j
isoStream.ToString();  ! l& ~& V9 ^8 |: W
D. IsolatedStorageFile isoFile;isoFile = IsolatedStorageFile.GetMachineStoreForAssembly();  ; p; p, d) l8 S+ @; d; `
IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream(  ) T/ [1 F; g+ G" }; h
"Settings.dat", FileMode.Open, isoFile); string result = isoStream.ToString();  / W& t+ y) I9 s6 j& y0 ~, a9 G
答案: B
回复

使用道具 举报

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

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

第 14 题   / _: }. C4 G  a8 i4 N) ~( P$ Q* p
你正在写一个压缩字节数组的方法。数组被以 document 作为参数名传递到一个方法。你需  
2 Q3 R3 }$ @5 i" a要压缩输入的字节数组并且返回一个字节数组作为结果。你的方法应该使用下面那个代码  . M. `/ |4 _( }, |- M1 k8 ]: s5 ^
段?  
6 E# q3 i( o, P( W3 }, L6 \$ vA. MemoryStream strm = new MemoryStream(document);DeflateStream deflate = new  * i) e; r8 Y, P' ~7 c: @9 u
DeflateStream(strm,CompressionMode.Compress); byte[] result = new  2 Y$ T, Y3 q; R0 ]9 v2 f
byte[document.Length];deflate.Write(result,0, result.Length); return result;  ' o+ ?* Y, c8 ^
B. MemoryStream strm = new MemoryStream(document);DeflateStream deflate = new  * f- T: C7 M- r7 c5 ]$ `( d9 R! A
DeflateStream(strm,  # [) s5 _/ e2 ^3 y/ J
CompressionMode.Comress);deflate.Write(docemtn, 0,  " N8 `, s0 z. v' Z* T* b! g% z8 Q
document.Length);deflate.Close();return strm.ToArray();  
- T% s3 N0 S$ C1 d2 ZC. MemoryStream strm = new MemoryStream();DeflateStream deflate = new  
0 ~5 k5 |1 |/ {( s2 nDeflateStream(strm, CompressionMode.Compress);deflate.Write(decument, 0,  8 `3 f8 h# {4 Z8 ~
decument.Length);deflate.Close();return strm.ToArray();  ; S% M7 ]5 C0 I+ S6 R. L: C- p
D. MemoryStream inStream = new MemoryStream(document);DeflateStream deflate =  
! x+ f$ n- k, @, m& ?/ rnew DeflateStream(inStream, CompressionMode.Compress); MemoryStream outStream =  
7 M5 {, Y* J8 ^$ pnew MemoryStream();int b;while ((b = deflate.ReadByte()) ! = -1) {  
+ Z2 d$ x. U4 f( U: L& `outStream.WriteByte((byte)b);} return outStream.ToArray();  
% L1 F  H$ f' W5 B( L# B; t! L& t答案: C
+ `: H: U8 F5 D9 ^  H$ s) N4 A( s6 I: L$ H- i. J9 q8 n
第 15 题  5 L3 b( x; p: W7 b
你需要选择一个类。它基于Key实现了小集合和大集合的优化。你应该选择下面那一个类?  
% q! G5 n+ }! w' lA. OrderedDictionary class  # E: C( m( M* Y& x# w3 d+ A' k5 v# J
B. HybridDictionary class  & s, I# f) u' i1 S% g- u
C. ListDictionary class  5 @0 Q' \; A8 M+ I! M
D. Hashtable class  . v- @. q, u" W8 l
答案: B
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-4 04:58 , Processed in 0.223633 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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