為大家收集整理了《2013微軟認證考試練習(xí)題及答案(3)》供大家參考,希望對大家有所幫助?。?!
第 11 題 你寫了如下一段代碼 public delegate void FaxDocs(object sender, FaxArgs args); 你需要創(chuàng)建一個調(diào)用FaxDocs的事件,你應(yīng)該使用那個代碼段? A. pulic static event FaxDocs Fax; B. public static event Fax FaxDocs; C. public class FaxArgs : EventArgs { private string coverPageInfo; public FaxArgs(string coverInfo) { this.coverPageInfo = coverPageInfo; } public string CoverPageInformation { get {return this.coverPageInfo;} }} D. public class FaxArgs : EventArgs { private string coverPageInfo; public string CoverPageInformation { get {return this.coverPageInfo;} }} 答案: A 第 12 題 你寫如下的代碼段去調(diào)用Win32 Application Programming Interface (API): string personName = "N?el"; string msg = "Welcome" + personName + "to club"!"; bool rc =User32API.MessageBox(0, msg, personName, 0); 為了實現(xiàn)上面的調(diào)用,你需要定義一個方法原型,請問,你會采用那個代碼段進行定義? A. [DllImport("user32", CharSet = CharSet.Ansi)] public static extern bool MessageBox(int hWnd,String text,String caption,uint type);} B. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet = CharSet.Ansi)] Public static extern bool MessageBox(int hWnd, [MarshalAs(UnmanagedType.LPWStr)]String text, [MarshalAs(UnmanagedType.LPWStr)]String caption, uint type);} C. [DllImport("user32", CharSet = CharSet.Unicode)] public static extern bool MessageBox(int hWnd,String text, String caption,uint type);} D. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet = CharSet.Unicode)]public static extern bool MessageBox(int hWnd, [MarshalAs(UnmanagedType.LPWStr)]String text, [MarshalAs(UnmanagedType.LPWStr)]String caption,uint type);} 答案:C
第 13 題 你需要以字符串的形式返回isolated storage文件內(nèi)容。已知,文件名稱為Settings.dat并且在機 器范圍內(nèi)。你應(yīng)該使用下面那個代碼段? A. IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream( "Settings.dat", FileMode.Open); string result = new StreamReader(isoStream).ReadToEnd(); B. IsolatedStorageFile isoFile;isoFile = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream( "Settings.dat", FileMode.Open, isoFile); string result = new StreamReader(isoStream).ReadToEnd(); C. IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream("Settings.dat", FileMode.Open); string result = isoStream.ToString(); D. IsolatedStorageFile isoFile;isoFile = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream( "Settings.dat", FileMode.Open, isoFile); string result = isoStream.ToString(); 答案: B 第 14 題 你正在寫一個壓縮字節(jié)數(shù)組的方法。數(shù)組被以 document 作為參數(shù)名傳遞到一個方法。你需 要壓縮輸入的字節(jié)數(shù)組并且返回一個字節(jié)數(shù)組作為結(jié)果。你的方法應(yīng)該使用下面那個代碼 段? A. MemoryStream strm = new MemoryStream(document);DeflateStream deflate = new DeflateStream(strm,CompressionMode.Compress); byte[] result = new byte[document.Length];deflate.Write(result,0, result.Length); return result; B. MemoryStream strm = new MemoryStream(document);DeflateStream deflate = new DeflateStream(strm, CompressionMode.Comress);deflate.Write(docemtn, 0, document.Length);deflate.Close();return strm.ToArray(); C. MemoryStream strm = new MemoryStream();DeflateStream deflate = new DeflateStream(strm, CompressionMode.Compress);deflate.Write(decument, 0, decument.Length);deflate.Close();return strm.ToArray(); D. MemoryStream inStream = new MemoryStream(document);DeflateStream deflate = new DeflateStream(inStream, CompressionMode.Compress); MemoryStream outStream = new MemoryStream();int b;while ((b = deflate.ReadByte()) ! = -1) { outStream.WriteByte((byte)b);} return outStream.ToArray(); 答案: C
第 15 題 你需要選擇一個類。它基于Key實現(xiàn)了小集合和大集合的優(yōu)化。你應(yīng)該選擇下面那一個類? A. OrderedDictionary class B. HybridDictionary class C. ListDictionary class D. Hashtable class 答案: B
第 11 題 你寫了如下一段代碼 public delegate void FaxDocs(object sender, FaxArgs args); 你需要創(chuàng)建一個調(diào)用FaxDocs的事件,你應(yīng)該使用那個代碼段? A. pulic static event FaxDocs Fax; B. public static event Fax FaxDocs; C. public class FaxArgs : EventArgs { private string coverPageInfo; public FaxArgs(string coverInfo) { this.coverPageInfo = coverPageInfo; } public string CoverPageInformation { get {return this.coverPageInfo;} }} D. public class FaxArgs : EventArgs { private string coverPageInfo; public string CoverPageInformation { get {return this.coverPageInfo;} }} 答案: A 第 12 題 你寫如下的代碼段去調(diào)用Win32 Application Programming Interface (API): string personName = "N?el"; string msg = "Welcome" + personName + "to club"!"; bool rc =User32API.MessageBox(0, msg, personName, 0); 為了實現(xiàn)上面的調(diào)用,你需要定義一個方法原型,請問,你會采用那個代碼段進行定義? A. [DllImport("user32", CharSet = CharSet.Ansi)] public static extern bool MessageBox(int hWnd,String text,String caption,uint type);} B. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet = CharSet.Ansi)] Public static extern bool MessageBox(int hWnd, [MarshalAs(UnmanagedType.LPWStr)]String text, [MarshalAs(UnmanagedType.LPWStr)]String caption, uint type);} C. [DllImport("user32", CharSet = CharSet.Unicode)] public static extern bool MessageBox(int hWnd,String text, String caption,uint type);} D. [DllImport("user32", EntryPoint = "MessageBoxA", CharSet = CharSet.Unicode)]public static extern bool MessageBox(int hWnd, [MarshalAs(UnmanagedType.LPWStr)]String text, [MarshalAs(UnmanagedType.LPWStr)]String caption,uint type);} 答案:C
第 13 題 你需要以字符串的形式返回isolated storage文件內(nèi)容。已知,文件名稱為Settings.dat并且在機 器范圍內(nèi)。你應(yīng)該使用下面那個代碼段? A. IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream( "Settings.dat", FileMode.Open); string result = new StreamReader(isoStream).ReadToEnd(); B. IsolatedStorageFile isoFile;isoFile = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream( "Settings.dat", FileMode.Open, isoFile); string result = new StreamReader(isoStream).ReadToEnd(); C. IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream("Settings.dat", FileMode.Open); string result = isoStream.ToString(); D. IsolatedStorageFile isoFile;isoFile = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoStream;isoStream = new IsolatedStorageFileStream( "Settings.dat", FileMode.Open, isoFile); string result = isoStream.ToString(); 答案: B 第 14 題 你正在寫一個壓縮字節(jié)數(shù)組的方法。數(shù)組被以 document 作為參數(shù)名傳遞到一個方法。你需 要壓縮輸入的字節(jié)數(shù)組并且返回一個字節(jié)數(shù)組作為結(jié)果。你的方法應(yīng)該使用下面那個代碼 段? A. MemoryStream strm = new MemoryStream(document);DeflateStream deflate = new DeflateStream(strm,CompressionMode.Compress); byte[] result = new byte[document.Length];deflate.Write(result,0, result.Length); return result; B. MemoryStream strm = new MemoryStream(document);DeflateStream deflate = new DeflateStream(strm, CompressionMode.Comress);deflate.Write(docemtn, 0, document.Length);deflate.Close();return strm.ToArray(); C. MemoryStream strm = new MemoryStream();DeflateStream deflate = new DeflateStream(strm, CompressionMode.Compress);deflate.Write(decument, 0, decument.Length);deflate.Close();return strm.ToArray(); D. MemoryStream inStream = new MemoryStream(document);DeflateStream deflate = new DeflateStream(inStream, CompressionMode.Compress); MemoryStream outStream = new MemoryStream();int b;while ((b = deflate.ReadByte()) ! = -1) { outStream.WriteByte((byte)b);} return outStream.ToArray(); 答案: C
第 15 題 你需要選擇一個類。它基于Key實現(xiàn)了小集合和大集合的優(yōu)化。你應(yīng)該選擇下面那一個類? A. OrderedDictionary class B. HybridDictionary class C. ListDictionary class D. Hashtable class 答案: B

