a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 244|回复: 1

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

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
第 46 题  ( Y% p$ c2 |9 B
你创建了一个发送 e-mail 的应用。一个名称为 smtp.Company.com 的 SMTP 服务器在本地子    M  r$ K4 n- a' b0 o- C" O3 ^5 p
网 是 可 用 的 。 为 了 测 试 应 用 , 你 使 用 源 地 址 为   me@Company.com , 目 标 地 址 为  3 [. r% E! C% P4 J6 D( V4 A
you@Company.com。你应该使用下面那个代码段去发送 e-mail?  ( `6 i! t0 L$ O8 ~; w# ^+ u
  
. ]2 ?# o, k  E' g5 OA. Dim MailFrom As New MailAddress("me@Company.com", "Me")  ( h1 i" E; h, W. [
Dim MailTo As New MailAddress("you@Company.com", "You")  ' p& Z" g& k! B, @; z
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =  
' k- j) C* t- b3 A! ~/ p"Greetings"Message.Body = "Test"Message.Dispose()  6 G6 |' v- X3 q" k  H4 G/ d9 D
B. Dim SMTPClient As String = "smtp.Company.com"  
* P" n+ P& d+ |# P, n9 o) gDim MailFrom As String = me@Company.com  ( x4 }* Z* Q* ?
Dim MailTo As String = you@Company.com  ! Y7 h, B9 O7 e' f
Dim Subject As String = "Greetings"  " N- m2 W+ k( P) [( h
Dim Body As String = "Test"Dim Message As New MailMessage(MailFrom, MailTo,  # ]% n) T3 Q1 Y: \% f. E8 Y
Subject, SMTPClient)  % c9 j6 t$ H- x* j, i; `9 J
C. Dim MailFrom As New MailAddress("me@Company.com", "Me")  
9 j& ^% ~& f& |+ O) `# LDim MailTo As New MailAddress("you@Company.com", "You")  
: ]: ^6 v. c. @+ gDim Message As New MailMessage(MailFrom, MailTo)Message.Subject =  8 c6 Z8 N( W  A! s
"Greetings"Message.Body = "Test"  # X/ @9 d/ N% w
Dim objClient As New SmtpClient("smtp.Company.com")objClient.Send(Message)  + |0 H% T* \# k% T5 @) @- _
D. Dim MailFrom As New MailAddress("me@Company.com", "Me")  
/ |, l8 d2 M- _" L& QDim MailTo As New MailAddress("you@Company.com", "You")  5 u  _; n4 H, j: y5 S7 M
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =  
# ?+ M2 A7 K, I8 D) _, {7 s. O5 s; c"Greetings"Message.Body = "Test"  
* B2 ^# T) @$ b. JDim Info As New SocketInformationDim Client As New Socket(Info)  
: E& S" {1 H& D1 ~3 @Dim Enc As New ASCIIEncodingDim Bytes() As Byte =  
7 i9 u: S8 [) _; V; I4 cEnc.GetBytes(Message.ToString)Client.Send(Bytes)  * W, X. g+ d: w' B& M
答案: C
0 _, D# K+ Z! f
; @) t# F9 t; ]9 b第 47 题  
0 d1 a7 ?/ t9 p* x& m, s) B你需要写一个代码段,从一个流变量  stream1  截取开始的  80  个字节到一个新的字节数组  
# }3 R+ F: ?/ i( `" l* lbyteArray 中。你同时也需要保证代码段把截取的字节数保存到一个整型变量 bytesTransferred  2 V+ s) ~4 j, `2 y, o: e
中,你应该使用下面那个代码段?    g0 Z3 E2 q) v% T8 Z5 F! ^, u
A. bytesTransferred = stream1.Read(byteArray, 0, 80);  / c! `. ~6 u7 @/ A6 {* s- \$ j( i
B. for (int i = 0; i < 80; i++) {  
9 Y% O1 w+ I9 }7 lstream1.WriteByte(byteArray);  9 K% _) L5 _4 H+ X  S% K6 x
bytesTransferred = i;  
  M; |( P1 r. `9 u5 C5 ]5 T: vif (!stream1.CanWrite) {  
7 z3 o- f- w, D# }' R7 Dbreak;    T) e2 R' w4 x" ~7 h' |
}}  0 E1 C6 _; b5 X# B! j
C. while (bytesTransferred < 80) {  8 J: h# p, t; g- P
stream1.Seek(1, SeekOrigin.Current);  . z* C: C* L/ w$ C$ U
byteArray[bytesTransferred++] =  
2 c+ L( F0 ]; i6 |+ x" J! DConvert.ToByte(stream1.ReadByte());}  
2 I  Z$ j5 N/ O7 Y, nD. stream1.Write(byteArray, 0, 80);bytesTransferred = byteArray.Length;  
8 Y2 g% N8 Y# W9 B, e. T: _答案: A  & W7 _( G6 ]9 p, S; C
  
1 R5 \8 F4 [. E8 |! O/ A! v: ?第 48 题  
# e/ E# j& C4 @4 h. S7 f& i你正在创建一个存储不同地域的客户信息的应用。你为这个应用开发了一个内部的测试版本。  
9 W, H8 U7 l- u& c# j你需要收集加拿大客户的区域信息,你应该使用那个代码段?  
* r$ Z8 |! n. \7 V4 T$ E' |1 MA.   foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))  
- }+ j7 G: F! [; t0 H{ //Output the region information...}  
* z7 p: s% @9 TB. CultureInfo cultureInfo = new CultureInfo("CA"); // Output the region information&frac14;  3 V" Q$ U- {$ G% u# ^
C. RegionInfo regionInfo = new RegionInfo("CA"); // Output the region information&frac14;  ' w! r9 U+ r" Z3 X. s
D. RegionInfo regionInfo = new RegionInfo("");if(regionInfo.Name == "CA") {  / i, z+ \- g9 S5 x' Y; M: `. O0 |
// Output the region information...}
回复

使用道具 举报

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

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

答案: C  9 r' C' R' v9 R, d
- K* I  `) I# j3 D5 Y4 F; @5 i
第 49 题  # }7 B1 X+ e$ O$ K3 q
你正在开发一个在网络上传输铭感信息的服务器应用。你创建了一个  X509Certificate  对象  6 d6 f+ C+ a" Z6 ?: h
certificate 和一个 TcpClient 对象 client。你需要创建一个 SslStream 对象,从而通过 Transport  
! Y* f( J$ H! P* Z. K: E6 ?6 u, ~7 B1 [Layer Security 1.0 协议(TLS 1.0  安全协议)进行通讯。你应该使用那个代码段?  8 X/ E% b. w" q; v& G
A. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,  / X2 l5 l0 N4 ]! i" |
false, SslProtocols.None, true);  
& r6 p+ M, b" o! G1 J; {6 u8 E1 y; LB. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,  
: Q2 b, V) |% J4 d% vfalse, SslProtocols.Ssl3, true);    c8 D% ?  ^/ s3 p; ?9 C
C. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,  + L3 {0 O! g3 ]5 R4 n
false, SslProtocols.Ssl2, true);  
6 d4 S4 ?. u8 j4 gD. SslStream ssl = new SslStream(client.GetStream()); ssl.AuthenticateAsServer(certificate,  
$ h4 H+ A3 \7 Hfalse, SslProtocols.Tls, true);  
0 e& g6 m) O' p/ B& p答案: D  1 V. n$ y+ n5 [0 B
  " P& E, B1 Q) O7 k
第 50 题  
0 W5 P; G/ A$ W+ ^1 s6 F你正在开发一个使用 DES(Data Encryption Standard)算法加密铭感数据的方法。你的方法  
' q# e4 h1 Y0 `2 c7 U/ p接收如下参数:将被加密的字节数组 message,密钥 key,始化向量 iv。  
3 p0 E! K# T# x6 @7 u你需要去加密数据,你也需要把加密数据写入MemoryStream  对象。你应该使用那段代码?  
2 S6 w) u4 q+ G; p; RA. DES des = new DESCryptoServiceProvider();  
+ b- @4 G6 }7 X6 p1 ]% Gdes.BlockSize = message.Length;ICryptoTransform crypto = des.CreateEncryptor(key, iv);  ( t  g% S) ?) O. T
MemoryStream cipherStream = new MemoryStream();  
* W! h$ \! H% n* m8 A) C* s0 dCryptoStream cryptoStream = new CryptoStream(cipherStream,  & i% s5 b& T* P; U9 h0 {& m' a- D1 L
crypto, CryptoStreamMode.Write);  
" h0 [9 }9 S4 ~8 RcryptoStream.Write(message, 0, message.Length);  
0 n! F8 Z) M! @$ j; b9 vB. DES des = new DESCryptoServiceProvider();  
  A+ `% y. O) a8 f( `/ U* D$ HICryptoTransform crypto = des.CreateDecryptor(key, iv);  ! A& R- p" N7 q2 U5 q  E
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =  4 n+ J1 k. n8 j
new CryptoStream(cipherStream,  9 p% b. I. D' B: x+ P
crypto, CryptoStreamMode.Write);  * h% x7 r3 t) O9 o
cryptoStream.Write(message, 0, message.Length);  2 I4 S8 t. z9 B: Y- @
C. DES des = new DESCryptoServiceProvider();ICryptoTransform crypto =  & j3 h* r0 k" T. c/ B9 s* d
des.CreateEncryptor();  
5 c. w8 T$ G0 zMemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =  ) M* ?2 Y; C3 @6 ^
new CryptoStream(cipherStream,  
3 s7 \& u# b5 g3 K! |2 ?0 k( Xcrypto, CryptoStreamMode.Write);  ( T0 y1 G, e# v- D
cryptoStream.Write(message, 0, message.Length);  
7 o# R& w& c# s  m6 u+ LD. DES des = new DESCryptoServiceProvider();ICryptoTransform crypto =  8 j1 R0 E- J2 @4 ^. z$ Y) ^3 |
des.CreateEncryptor(key, iv);  3 Q$ f" q" [  m) L/ b" T/ d2 q
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =  ) W. b) ~1 e# ]3 K
new CryptoStream(cipherStream,  
; z2 K' ~; Q2 j* K4 A$ m( zcrypto, CryptoStreamMode.Write);cryptoStream.Write(message, 0, message.Length);  " ?& N* i0 c  Y1 h
答案: D
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-29 11:55 , Processed in 0.184544 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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