会计考友 发表于 2012-8-3 00:09:22

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

第 46 题
你创建了一个发送 e-mail 的应用。一个名称为 smtp.Company.com 的 SMTP 服务器在本地子
网 是 可 用 的 。 为 了 测 试 应 用 , 你 使 用 源 地 址 为   me@Company.com , 目 标 地 址 为
you@Company.com。你应该使用下面那个代码段去发送 e-mail?

A. Dim MailFrom As New MailAddress("me@Company.com", "Me")
Dim MailTo As New MailAddress("you@Company.com", "You")
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =
"Greetings"Message.Body = "Test"Message.Dispose()
B. Dim SMTPClient As String = "smtp.Company.com"
Dim MailFrom As String = me@Company.com
Dim MailTo As String = you@Company.com
Dim Subject As String = "Greetings"
Dim Body As String = "Test"Dim Message As New MailMessage(MailFrom, MailTo,
Subject, SMTPClient)
C. Dim MailFrom As New MailAddress("me@Company.com", "Me")
Dim MailTo As New MailAddress("you@Company.com", "You")
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =
"Greetings"Message.Body = "Test"
Dim objClient As New SmtpClient("smtp.Company.com")objClient.Send(Message)
D. Dim MailFrom As New MailAddress("me@Company.com", "Me")
Dim MailTo As New MailAddress("you@Company.com", "You")
Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject =
"Greetings"Message.Body = "Test"
Dim Info As New SocketInformationDim Client As New Socket(Info)
Dim Enc As New ASCIIEncodingDim Bytes() As Byte =
Enc.GetBytes(Message.ToString)Client.Send(Bytes)
答案: C

第 47 题
你需要写一个代码段,从一个流变量stream1截取开始的80个字节到一个新的字节数组
byteArray 中。你同时也需要保证代码段把截取的字节数保存到一个整型变量 bytesTransferred
中,你应该使用下面那个代码段?
A. bytesTransferred = stream1.Read(byteArray, 0, 80);
B. for (int i = 0; i < 80; i++) {
stream1.WriteByte(byteArray);
bytesTransferred = i;
if (!stream1.CanWrite) {
break;
}}
C. while (bytesTransferred < 80) {
stream1.Seek(1, SeekOrigin.Current);
byteArray =
Convert.ToByte(stream1.ReadByte());}
D. stream1.Write(byteArray, 0, 80);bytesTransferred = byteArray.Length;
答案: A

第 48 题
你正在创建一个存储不同地域的客户信息的应用。你为这个应用开发了一个内部的测试版本。
你需要收集加拿大客户的区域信息,你应该使用那个代码段?
A.   foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{ //Output the region information...}
B. CultureInfo cultureInfo = new CultureInfo("CA"); // Output the region information&frac14;
C. RegionInfo regionInfo = new RegionInfo("CA"); // Output the region information&frac14;
D. RegionInfo regionInfo = new RegionInfo("");if(regionInfo.Name == "CA") {
// Output the region information...}

会计考友 发表于 2012-8-3 00:09:23

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

答案: C

第 49 题
你正在开发一个在网络上传输铭感信息的服务器应用。你创建了一个X509Certificate对象
certificate 和一个 TcpClient 对象 client。你需要创建一个 SslStream 对象,从而通过 Transport
Layer Security 1.0 协议(TLS 1.0安全协议)进行通讯。你应该使用那个代码段?
A. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,
false, SslProtocols.None, true);
B. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,
false, SslProtocols.Ssl3, true);
C. SslStream ssl = new SslStream(client.GetStream());ssl.AuthenticateAsServer(certificate,
false, SslProtocols.Ssl2, true);
D. SslStream ssl = new SslStream(client.GetStream()); ssl.AuthenticateAsServer(certificate,
false, SslProtocols.Tls, true);
答案: D

第 50 题
你正在开发一个使用 DES(Data Encryption Standard)算法加密铭感数据的方法。你的方法
接收如下参数:将被加密的字节数组 message,密钥 key,始化向量 iv。
你需要去加密数据,你也需要把加密数据写入MemoryStream对象。你应该使用那段代码?
A. DES des = new DESCryptoServiceProvider();
des.BlockSize = message.Length;ICryptoTransform crypto = des.CreateEncryptor(key, iv);
MemoryStream cipherStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(cipherStream,
crypto, CryptoStreamMode.Write);
cryptoStream.Write(message, 0, message.Length);
B. DES des = new DESCryptoServiceProvider();
ICryptoTransform crypto = des.CreateDecryptor(key, iv);
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =
new CryptoStream(cipherStream,
crypto, CryptoStreamMode.Write);
cryptoStream.Write(message, 0, message.Length);
C. DES des = new DESCryptoServiceProvider();ICryptoTransform crypto =
des.CreateEncryptor();
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =
new CryptoStream(cipherStream,
crypto, CryptoStreamMode.Write);
cryptoStream.Write(message, 0, message.Length);
D. DES des = new DESCryptoServiceProvider();ICryptoTransform crypto =
des.CreateEncryptor(key, iv);
MemoryStream cipherStream = new MemoryStream();CryptoStream cryptoStream =
new CryptoStream(cipherStream,
crypto, CryptoStreamMode.Write);cryptoStream.Write(message, 0, message.Length);
答案: D
页: [1]
查看完整版本: 2012年微软认证考试模拟试题及答案10