a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 252|回复: 1

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

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
第 46 题  
7 ?9 \; W* `8 A7 l7 c, \你创建了一个发送 e-mail 的应用。一个名称为 smtp.Company.com 的 SMTP 服务器在本地子  
9 e( {3 ?( u: Y7 ^6 U3 _# ?% k网 是 可 用 的 。 为 了 测 试 应 用 , 你 使 用 源 地 址 为   me@Company.com , 目 标 地 址 为  
8 N, o9 {% f. Fyou@Company.com。你应该使用下面那个代码段去发送 e-mail?  
' i8 E) M: a& J# u+ u1 F- v  G9 U  
6 C; o, D8 V, `: z, R6 C7 Y' YA. Dim MailFrom As New MailAddress("me@Company.com", "Me")  
1 C9 R4 v+ Q+ _: cDim MailTo As New MailAddress("you@Company.com", "You")  ; l8 q7 R7 v' U& O) q  a
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =  
7 F/ \1 w, c/ ~& x  Z) _+ l6 V"Greetings"Message.Body = "Test"Message.Dispose()  
, G0 L7 W$ W, m- o' IB. Dim SMTPClient As String = "smtp.Company.com"  ! ]' p4 e& ]6 k/ v" ^9 G
Dim MailFrom As String = me@Company.com  
$ \% u* W! B; P4 G$ B/ sDim MailTo As String = you@Company.com  
, r  Q) |8 p- gDim Subject As String = "Greetings"  
+ O2 U3 F4 g. `) j% K; {7 _Dim Body As String = "Test"Dim Message As New MailMessage(MailFrom, MailTo,  
- e" a' r  _; J, Y6 N% N$ E/ ISubject, SMTPClient)  
, M  X+ V; \3 E  C1 v, j& i# zC. Dim MailFrom As New MailAddress("me@Company.com", "Me")    T) ?7 N3 H! F
Dim MailTo As New MailAddress("you@Company.com", "You")  . e2 Q  F( c' Y; N! n: x* v+ s
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =  ' ~8 ?% y3 t/ ~! U: t! j  }
"Greetings"Message.Body = "Test"  
% z* W8 S2 {) K; |4 Y  p0 lDim objClient As New SmtpClient("smtp.Company.com")objClient.Send(Message)  
# i9 S0 l3 S9 h8 B. ^# `" y( |D. Dim MailFrom As New MailAddress("me@Company.com", "Me")  * c0 s; F7 W$ [' T
Dim MailTo As New MailAddress("you@Company.com", "You")  % t3 p1 }7 X- A. T
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =  : `! X. I  w, b3 x7 ]
"Greetings"Message.Body = "Test"  6 j# e% R& b4 t
Dim Info As New SocketInformationDim Client As New Socket(Info)  # \! O8 L  F: I5 e5 V
Dim Enc As New ASCIIEncodingDim Bytes() As Byte =  3 @( X' K( c' z
Enc.GetBytes(Message.ToString)Client.Send(Bytes)  
, \% k2 l. x& O0 q$ e/ l1 g7 f8 s' e答案: C / g+ A8 h+ d% p! `, P
8 R0 I, K8 ], ?5 c0 g
第 47 题  - p: E& ^# V1 m' T, d0 I
你需要写一个代码段,从一个流变量  stream1  截取开始的  80  个字节到一个新的字节数组  
- l* N5 q) _8 P9 I" ^# vbyteArray 中。你同时也需要保证代码段把截取的字节数保存到一个整型变量 bytesTransferred  5 i) S* `1 H0 }7 z8 o% g; A
中,你应该使用下面那个代码段?  . p( h* N' U- n! {7 o
A. bytesTransferred = stream1.Read(byteArray, 0, 80);  ! Z. ]: p7 s6 ?5 }$ _$ R0 Y
B. for (int i = 0; i < 80; i++) {  
6 g# f6 \0 i5 r7 U- g  fstream1.WriteByte(byteArray);  1 r5 M% k* i" u- t
bytesTransferred = i;  . C& m# J4 W1 M" o; p
if (!stream1.CanWrite) {  6 R! x% F4 O" F( g
break;  
  Q; M7 f  u0 y1 z0 n9 U) o}}  
& A  H7 G' U- J# \5 t" ]4 h  \5 MC. while (bytesTransferred < 80) {  7 X- P9 T0 C' u$ f' {
stream1.Seek(1, SeekOrigin.Current);  
" q8 D6 r4 w# p& |- qbyteArray[bytesTransferred++] =  1 Q- l6 y, T* m* o/ o, G; S1 A9 s5 G
Convert.ToByte(stream1.ReadByte());}  * c# m, g9 f; F& {  X( S  i0 y
D. stream1.Write(byteArray, 0, 80);bytesTransferred = byteArray.Length;  
, t, a  m' X  h2 ?2 _1 }& W答案: A  
3 r" s4 Y+ m2 H0 y  " S8 }/ J2 E! B5 c
第 48 题  6 B9 d# q* H) n8 ~& f' U
你正在创建一个存储不同地域的客户信息的应用。你为这个应用开发了一个内部的测试版本。  # T. M& |/ v& k7 S7 q# K: t
你需要收集加拿大客户的区域信息,你应该使用那个代码段?  
! r  {; C) k5 v  `# UA.   foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))  ' u' ~! b# ~) g) l# j! ^( J
{ //Output the region information...}  # i' W4 B9 b4 g9 g, n9 A" l
B. CultureInfo cultureInfo = new CultureInfo("CA"); // Output the region information&frac14;  + o2 s/ u# z. E% m# W
C. RegionInfo regionInfo = new RegionInfo("CA"); // Output the region information&frac14;  ) }! k3 J) T6 b
D. RegionInfo regionInfo = new RegionInfo("");if(regionInfo.Name == "CA") {  ' y: J& V4 c* s1 \# r! x
// Output the region information...}
回复

使用道具 举报

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

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

答案: C  
- _- n7 J& `* {% G: M9 {" f# V; B. I1 E
第 49 题  , I! v8 I4 c- G+ B; g( D/ ^
你正在开发一个在网络上传输铭感信息的服务器应用。你创建了一个  X509Certificate  对象  
5 V% f; ?2 P+ q+ z; Lcertificate 和一个 TcpClient 对象 client。你需要创建一个 SslStream 对象,从而通过 Transport  ; j. y' E! d- D9 ^' Z2 y6 P: |% ]
Layer Security 1.0 协议(TLS 1.0  安全协议)进行通讯。你应该使用那个代码段?  % f4 r' B: ?: W
A. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,  
; G, _8 R& Y9 M  ]# ^; ]: o  dfalse, SslProtocols.None, true);  
5 o: m) d4 r! y' l1 QB. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,  # x: U- }. I' W" O2 S6 I5 R
false, SslProtocols.Ssl3, true);  
; \9 {( D0 |- Z2 S& NC. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,  " G: r1 J; T, E9 O3 R
false, SslProtocols.Ssl2, true);  : v: E# _4 u; o) R
D. SslStream ssl = new SslStream(client.GetStream()); ssl.AuthenticateAsServer(certificate,  
6 K* T" S4 R# @( }8 A: ffalse, SslProtocols.Tls, true);  
, `6 I$ M( |& i1 m答案: D  % ^1 C8 S$ l  L1 ~& m
  & o* ~% s+ ]$ e3 ~. }/ G
第 50 题  1 j7 w6 A& X1 ?8 y; _0 h
你正在开发一个使用 DES(Data Encryption Standard)算法加密铭感数据的方法。你的方法    A$ D8 c- k  Q$ }4 M
接收如下参数:将被加密的字节数组 message,密钥 key,始化向量 iv。  
2 I. i4 b: C# s: C& a3 f) ^你需要去加密数据,你也需要把加密数据写入MemoryStream  对象。你应该使用那段代码?  
9 K3 V( @1 [# C. K- r* xA. DES des = new DESCryptoServiceProvider();  
3 M2 N* U$ s, z* l5 tdes.BlockSize = message.Length;ICryptoTransform crypto = des.CreateEncryptor(key, iv);  
) c, U% c& J: O$ C( [! ]MemoryStream cipherStream = new MemoryStream();  
0 a& Z7 S/ X/ P% K$ z9 zCryptoStream cryptoStream = new CryptoStream(cipherStream,  
7 ~- R* M) I/ ucrypto, CryptoStreamMode.Write);  9 r; G1 S0 q3 D* `2 ^! H' j
cryptoStream.Write(message, 0, message.Length);  ) X) [9 ~: Z5 D! C. I9 {
B. DES des = new DESCryptoServiceProvider();  
/ W* P- [8 H% A5 ^8 VICryptoTransform crypto = des.CreateDecryptor(key, iv);  ( W& d1 z/ W9 B8 [
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =  ' C9 m9 u- S: Y# H5 D: W+ t
new CryptoStream(cipherStream,  
; |9 i2 {9 p" q% R0 Jcrypto, CryptoStreamMode.Write);  ) [9 f% m7 j9 e* f; {' U8 F
cryptoStream.Write(message, 0, message.Length);  
; h3 y; u" b* ~9 ^; A. |, c7 UC. DES des = new DESCryptoServiceProvider();ICryptoTransform crypto =  ' a! r, E* c, Q
des.CreateEncryptor();  * E. A$ H6 }6 X
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =  : w4 ?) ]/ ~6 g
new CryptoStream(cipherStream,  
" [4 k$ R, q; O- M: u1 `, Ycrypto, CryptoStreamMode.Write);  
6 {3 r! g6 _. [, h" ]4 x# fcryptoStream.Write(message, 0, message.Length);  
5 d# K+ h2 N; D: ~' c. UD. DES des = new DESCryptoServiceProvider();ICryptoTransform crypto =  
% V) B* H& A7 S( h$ B$ gdes.CreateEncryptor(key, iv);  
& `4 T6 O) B: s  @- s' qMemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =  3 H# P: u7 S  U. w9 N
new CryptoStream(cipherStream,  6 N( k; g3 M! q9 P$ v
crypto, CryptoStreamMode.Write);cryptoStream.Write(message, 0, message.Length);  3 F. o7 ]0 c3 z/ G2 j
答案: D
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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