2013微軟認(rèn)證考試練習(xí)題及答案(14)

字號(hào):

為大家收集整理了《2013微軟認(rèn)證考試練習(xí)題及答案(14)》供大家參考,希望對(duì)大家有所幫助?。?!
    第 66 題
    你正在改變文件 MyData.xml 的安全設(shè)置。你需要保留已經(jīng)繼承的訪問(wèn)規(guī)則,但是不會(huì)通過(guò)繼
    承被父對(duì)象修改。你應(yīng)該怎么做?
    A. FileSecurity security = new FileSecurity("mydata.xml",
    AccessControlSections.All);security.SetAccessRuleProtection(true,
    true);File.SetAccessControl("mydata.xml", security);
    B. FileSecurity security = new FileSecurity();security.SetAccessRuleProtection(true,
    true);File.SetAccessControl("mydata.xml", security);
    C. FileSecurity security =
    File.GetAccessControl("mydata.xml");security.SetAccessRuleProtection(true, true);
    D. FileSecurity security =
    File.GetAccessControl("mydata.xml");security.SetAuditRuleProtection(true,
    true);File.SetAccessControl("mydata.xml", security);
    答案: A
    第 67 題
    你正在創(chuàng)建一個(gè)類,它用于去比較指定格式的字符串。為此,你需要實(shí)現(xiàn) IComparable
    接口。你應(yīng)該使用下面那個(gè)代碼段?
    A. public class Person : IComparable{
    public int CompareTo(string other){
    }}
    B. public class Person : IComparable{
    public int CompareTo(object other){
    }}
    C. public class Person : IComparable{
    public bool CompareTo(string other){
    }}
    D. public class Person : IComparable{
    public bool CompareTo(object other){
    }}
    答案: A
    第 68 題
    你正在開發(fā)一個(gè)去解密數(shù)據(jù)的方法。已知數(shù)據(jù)是使用 Triple DES 算法進(jìn)行加密的。你的方法
    接收如下參數(shù):將被解密的字節(jié)數(shù)組 cipherMessage,密鑰 key,始化向量 iv。
    你需要使用TripleDES類去解密數(shù)據(jù),并且把結(jié)果放入一個(gè)字符串中。你應(yīng)該使用那段代碼?
    A. TripleDES des = new TripleDESCryptoServiceProvider();des.BlockSize =
    cipherMessage.Length;ICryptoTransform crypto = des.CreateDecryptor(key,
    iv);MemoryStream cipherStream = new MemoryStream(cipherMessage);CryptoStream
    cryptoStream =
    new CryptoStream(
    cipherStream, crypto, CryptoStreamMode.Read); string message;message = new
    StreamReader(cryptoStream).ReadToEnd();
    B. TripleDES des = new TripleDESCryptoServiceProvider();des.FeedbackSize =
    cipherMessage.Length;ICryptoTransform crypto = des.CreateDecryptor(key,
    iv);MemoryStream cipherStream = new MemoryStream(cipherMessage);CryptoStream
    cryptoStream =
    new CryptoStream(
    cipherStream, crypto, CryptoStreamMode.Read); string message;message = new
    StreamReader(cryptoStream).ReadToEnd();
    C. TripleDES des = new TripleDESCryptoServiceProvider();ICryptoTransform crypto =
    des.CreateDecryptor();MemoryStream cipherStream = new
    MemoryStream(cipherMessage);CryptoStream cryptoStream =
    new CryptoStream(
    cipherStream, crypto, CryptoStreamMode.Read); string message;message = new
    StreamReader(cryptoStream).ReadToEnd();
    D. TripleDES des = new TripleDESCryptoServiceProvider();ICryptoTransform crypto =
    des.CreateDecryptor(key, iv);MemoryStream cipherStream = new
    MemoryStream(cipherMessage);CryptoStream cryptoStream =
    new CryptoStream(
    cipherStream, crypto, CryptoStreamMode.Read); string message;message = new
    StreamReader(cryptoStream).ReadToEnd();
    答案: D
    第 69 題
    你需要寫一段代碼去創(chuàng)建一個(gè)新的應(yīng)用程序域。你應(yīng)該使用下面哪段代碼?
    A. AppDomainSetup mySetup =
    AppDomain.CurrentDomain.SetupInformation;mySetup.ShadowCopyFiles = "true";
    B. System.Diagnostics.Process myProcess;myProcess = new System.Diagnostics.Process();
    C. AppDomain domain; domain = AppDomain.CreateDomain("CompanyDomain"):
    D. System.ComponentModel.Component myComponent;myComponent = new
    System.ComponentModel.Component();
    答案: C
    第 70 題
    你正在測(cè)試一個(gè)執(zhí)行進(jìn)程檢查的方法。這個(gè)方法返回一個(gè)包含被進(jìn)程裝載的所有模塊的名稱
    和完整路徑的 ArrayList。現(xiàn)在,你需要列出被進(jìn)程 C:\TestApps\Process1.exe 裝載的所有模
    塊,你應(yīng)該使用下面哪段代碼?
    A. ArrayList ar = new ArrayList();Process[] procs;ProcessModuleCollection modules;procs =
    Process.GetProcesses(@"Process1");if (procs.Length > 0) {modules = porcs[0].Modules;
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.ModuleName);
    }}
    B. ArrayList ar = new ArrayList();Process[] procs;ProcessModuleCollection modules;procs =
    Process.GetProcesses(@"C:\TestApps\Process1.exe");if (procs.Length > 0) {modules =
    porcs[0].Modules;
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.ModuleName);
    }}
    C. ArrayList ar = new ArrayList();Process[] procs;ProcessModuleCollection modules;procs =
    Process.GetProcessesByName(@"Process1");if (procs.Length > 0) {modules =
    porcs[0].Modules;
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.FileName);
    }}
    D. ArrayList ar = new ArrayList();Process[] procs;ProcessModuleCollection modules;procs =
    Process.GetProcessesByName(@"C:\TestApps\Process1.exe");if
    (procs.Length > 0) {
    modules = porcs[0].Modules;
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.FileName);
    }}
    答案: C