网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
You need to write a multicast delegate that accepts a DateTime argument.Which code segment should you use?()
- A、public delegate int PowerDeviceOn(bool result,DateTime autoPowerOff);
- B、public delegate bool PowerDeviceOn(object sender,EventArgs autoPowerOff);
- C、public delegate void PowerDeviceOn(DateTime autoPowerOff);
- D、public delegate bool PowerDeviceOn(DateTime autoPowerOff);
参考答案
更多 “You need to write a multicast delegate that accepts a DateTime argument.Which code segment should you use?()A、public delegate int PowerDeviceOn(bool result,DateTime autoPowerOff);B、public delegate bool PowerDeviceOn(object sender,EventArgs autoPowerOff);C、public delegate void PowerDeviceOn(DateTime autoPowerOff);D、public delegate bool PowerDeviceOn(DateTime autoPowerOff);” 相关考题
考题
You need to write a code segment that transfers the contents of a byte array named dataToSendby using a NetworkStream object named netStream.You need to use a cache of size 8,192 bytes.Which code segment should you use?()A.B.C.D.
考题
您需要写一个接收日期参数的多播委托,您应该使用哪一个代码片段() //委托就是一个方法,题目没有返回值。
A.public delegate int PowerDeviceOn(bool result, DateTime autoPowerOff);B.public delegate bool PowerDeviceOn(object sender, EventArgs autoPowerOff);C.public delegate void PowerDeviceOn(DateTime autoPowerOff);D.public delegate bool PowerDeviceOn(DateTime autoPowerOff);
考题
您需要编写可接受日期时间参数并返回一个布尔值,多路广播的委托。您应该使用哪个代码段?()
A.public delegate int PowerDeviceOn(bool, DateTime);B.public delegate bool PowerDeviceOn(Object, EventArgs);C.public delegate void PowerDeviceOn(DateTime);D.public delegate bool PowerDeviceOn(DateTime);
考题
You are creating a Windows application for graphical image processing by using the .NET Framework 3.5. You create an image processing function and a delegate.You plan to invoke the image processing function by using the delegate.You need to ensure that the calling thread meets the following requirements: (1)It is not blocked when the delegate is running (2)It is notified when the delegate is complete What should you do?()A、Call the Invoke method of the delegate.B、Call the BeginInvoke and EndInvoke methods of the delegate in the calling thread.C、Call the BeginInvoke method by specifying a callback method to be executed when the delegate is complete.Call the EndInvoke method in the callback method.D、Call the BeginInvoke method by specifying a callback method to be executed when the delegate is complete.Call the EndInvoke method of the delegate in the calling thread.
考题
You are the Exchange administrator of the Xxx Corporation’s Exchange 2010 organization.You create a public folder named PublicFolder1 on a Mailbox server named MBX55 to enable users to post messages.You want your assistant, Josh, to configure PublicFolder1 to replicate with the Mailbox servers in other offices.To achieve this, you want Josh to run the Set-PublicFolder cmdlet to configure the replication schedule.You must delegate appropriate permissions to Josh to enable him to run the Set-PublicFolder cmdlet.What should you do?()A、Add Josh to the local Server Operators group.B、Delegate the Exchange Recipient Administrators role to Josh.C、Delegate the Exchange Public Folder Administrators role to Josh.D、Delegate the Exchange View-Only Administrators role to Josh.
考题
You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role namedAdministrators. Which code segment should you use?()A、bool isMember = Roles.GetUsersInRole("Administrators").Any()B、bool isMember = Membership.ValidateUser(User.Identity.Name, "Administrators")C、bool isMember = Roles.GetRolesForUser("Administrators").Any()D、bool isMember = User.IsInRole("Administrators")
考题
You work as a Web Developer at Certkiller.com. You make use of Microsoft ASP.NET 3.5 in orderto create a Web Site. In a separate code file you create the following class: public static class _Colors { public static Color NormalActivityColor = Color.Green; public static Color WarningActivityColor = Color.Yellow; public static Color ErrorActivityColor = Color.Red; public static Color GetRandomColor() { Random random = new Random((int)DateTime.Now.Ticks); int randomArgbValue = random.Next(); Color color = Color.FromArgb(255, Color.FromArgb(randomArgbValue)); return color; } } You need to ensure that the class is consumed by the Web Site. You have to configure the WebSite project. What should you do?()A、You should add the file to the App_Code folder of the project.B、You should add a Register directive that will reference the file to every page that makes use ofthe class.C、This can be accomplished by referencing the file in the assemblies segment of the Web.configfile.D、This can be accomplished by referencing the file in the httpHandlers segment of the Web.configfile.
考题
You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages. You create a static method named SiteHelper.Configure that configures the component. You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested. Which code segment should you use? ()A、void Application_Start(object sender, EventArgs e) { SiteHelper.Configure(); }B、void Application_Init(object sender, EventArgs e) { SiteHelper.Configure(); }C、void Application_BeginRequest(object sender, EventArgs e) { SiteHelper.Configure(); }D、Object lockObject = new Object(); void Application_BeginRequest(object sender, EventArgs e) { lock(lockObject()) { SiteHelper.Configure(); } }
考题
You create a Web Form. The Web Form allows users to calculate values and display the results in a label named lblResults. You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form. Which code segment should you use?()A、protected void Page_Error(object sender, EventArgs e) { lblResults.Text = e.ToString(); e=null;}B、protected void Page_Error(object sender, EventArgs e) { lblResults.Text = Server.GetLastError().ToString(); Server.ClearError();}C、protected void Page_Error(object sender, EventArgs e) Response.Write(e.ToString()); e=null;}D、protected void Page_Error(object sender, EventArgs e) Response.Write(Server.GetLastError().ToString()); Server.ClearError();}
考题
You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx. You add the following code to the code-behind file of TestPage.aspx. private void TestMethod(){ ...}You define the following delegate. public delegate void MyEventHandler(); You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the page’s TestMethod method to the event. Which two actions should you perform?()A、Add the following line of code to TestUserControl.ascx.cs. public event MyEventHandler MyEvent;B、Add the following line of code to TestUserControl.ascx.cs. public MyEventHandler MyEvent;C、Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID="testControl" runat="server" OnMyEvent="TestMethod"/D、Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID="testControl" runat="server" MyEvent="TestMethod"/
考题
You work as an application developer at Certkiller .com. You have been given the responsibility of creating a class named CalcSalary that will determine the salaries of Certkiller .com’s staff. The CalcSalary class includes methods to increment and decrement staff salaries. The following code is included in the CalcSalary class: public class CalcSalary { // for promotions public static bool IncrementSalary (Employee Emp, double Amount) { if (Emp.Status == QuarterlyReview.AboveGoals) Emp.Salary += Amount; return true; } else return false; } //for demotions public static bool DecrementSalary (Employee Emp, double Amount) { if (Emp.Status == QuarterlyReview.AboveGoals) Emp.Salary -= Amount; return true; } else return false; } } You would like to invoke the IncrementSalary and DecrementSalary methods dynamically at runtime from the sales manager application, and decide to create a delegate named SalaryDelegate to invoke them. You need to ensure that you use the appropriate code to declare the SalaryDelegate delegate.What is the correct line of code?()A、 public delegate bool Salary (Employee Emp, double Amount);B、 public bool Salary (Employee Emp, double Amount);C、 public event bool Salary (Employee Emp, double Amount);D、 public delegate void Salary (Employee Emp, double Amount);
考题
You are creating an ASP.NET Web site. You create a HTTP module named Custom Module, and you register the module in the web.config file.The Custom Module class contains the following code. Public Class Custom Module Implements IHttpModule Dim footerContent As String = Footer Content"Public Sub Dispose() Implements IHttpModule.DisposeEnd SubEnd Class You need to add code to CustomModule to append the footer content to each processed ASP.NET page. Which code segment should you use?()A、Public Sub New(ByVal app As HttpApplication) AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = TryCast(sender, HttpApplication) app.Response.Write(footerContent) End Sub B、Public Sub Init(ByVal app As HttpApplication) _ Implements IHttpModule.Init AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = New HttpApplication() app.Response.Write(footerContent) End Sub C、Public Sub New() Dim app As HttpApplication = New HttpApplication() AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = TryCast(sender, HttpApplication) app.Response.Write(footerContent) End Sub D、Public Sub Init(ByVal app As HttpApplication) _ Implements IHttpModule.Init AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = TryCast(sender, HttpApplication)app.Response.Write(footerContent) End Sub
考题
您需要编写可接受日期时间参数并返回一个布尔值,多路广播的委托。您应该使用哪个代码段?()A、public delegate int PowerDeviceOn(bool, DateTime);B、public delegate bool PowerDeviceOn(Object, EventArgs);C、public delegate void PowerDeviceOn(DateTime);D、public delegate bool PowerDeviceOn(DateTime);
考题
您已创建一个名为 CalcSalary,将确定 Certkiller.com 员工的薪酬类的责任。CalcSalary 类包括员工的薪酬递增和递减的方法。下面的代码包含在 CalcSalary 类中:()public class CalcSalary {// for promotionspublic static bool IncrementSalary (Employee Emp, double Amount){if (Emp.Status == QuarterlyReview.AboveGoals)Emp.Salary += Amount;return true;A、public delegate bool Salary (Employee Emp, double Amount);B、public bool Salary (Employee Emp, double Amount);C、public event bool Salary (Employee Emp, double Amount);D、public delegate void Salary (Employee Emp, double Amount);
考题
You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires a thread that accepts a single integer parameter. You write the following code segment (Line numbers are included for reference only.) Thread myThread = new Thread(new ParameterizedThreadStart(DoWork)) ; myThread.Start(100); You need to declare the method signature of the DoWork method. Which method signature should you use?()A、public void DoWork();B、public void DoWork(int nCounter);C、public void DoWork(object oCounter);D、public void DoWork(Delegate oCounter);
考题
单选题You are creating a Windows application for graphical image processing by using the .NET Framework 3.5. You create an image processing function and a delegate.You plan to invoke the image processing function by using the delegate.You need to ensure that the calling thread meets the following requirements: (1)It is not blocked when the delegate is running (2)It is notified when the delegate is complete What should you do?()A
Call the Invoke method of the delegate.B
Call the BeginInvoke and EndInvoke methods of the delegate in the calling thread.C
Call the BeginInvoke method by specifying a callback method to be executed when the delegate is complete.Call the EndInvoke method in the callback method.D
Call the BeginInvoke method by specifying a callback method to be executed when the delegate is complete.Call the EndInvoke method of the delegate in the calling thread.
考题
单选题您需要写一个接收日期参数的多播委托,您应该使用哪一个代码片段() //委托就是一个方法,题目没有返回值。A
public delegate int PowerDeviceOn(bool result, DateTime autoPowerOff);B
public delegate bool PowerDeviceOn(object sender, EventArgs autoPowerOff);C
public delegate void PowerDeviceOn(DateTime autoPowerOff);D
public delegate bool PowerDeviceOn(DateTime autoPowerOff);
考题
单选题You work as an application developer at Certkiller .com. You have recently created an application that includes the code shown below. public delegate stringGetFileContentsDel (); public string GetFileContents () { //Process file and return results } You now need to invoke the GetFileContents method asynchronously. You have to ensure that the code you use to invoke the GetFileContents method will continue to process other user instructions, and displays the results as soon as the GetFileContents method finishes processing.What should you do?()A
AB
BC
CD
D
考题
单选题You create a Web Form. The Web Form allows users to calculate values and display the results in a label named lblResults. You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form. Which code segment should you use?()A
protected void Page_Error(object sender, EventArgs e) { lblResults.Text = e.ToString(); e=null;}B
protected void Page_Error(object sender, EventArgs e) { lblResults.Text = Server.GetLastError().ToString(); Server.ClearError();}C
protected void Page_Error(object sender, EventArgs e) Response.Write(e.ToString()); e=null;}D
protected void Page_Error(object sender, EventArgs e) Response.Write(Server.GetLastError().ToString()); Server.ClearError();}
考题
单选题You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages. You create a static method named SiteHelper.Configure that configures the component. You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested. Which code segment should you use? ()A
void Application_Start(object sender, EventArgs e) { SiteHelper.Configure(); }B
void Application_Init(object sender, EventArgs e) { SiteHelper.Configure(); }C
void Application_BeginRequest(object sender, EventArgs e) { SiteHelper.Configure(); }D
Object lockObject = new Object(); void Application_BeginRequest(object sender, EventArgs e) { lock(lockObject()) { SiteHelper.Configure(); } }
考题
单选题You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires a thread that accepts a single integer parameter. You write the following code segment (Line numbers are included for reference only.) Thread myThread = new Thread(new ParameterizedThreadStart(DoWork)) ; myThread.Start(100); You need to declare the method signature of the DoWork method. Which method signature should you use?()A
public void DoWork();B
public void DoWork(int nCounter);C
public void DoWork(object oCounter);D
public void DoWork(Delegate oCounter);
考题
多选题You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx. You add the following code to the code-behind file of TestPage.aspx. private void TestMethod(){ ...}You define the following delegate. public delegate void MyEventHandler(); You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the page’s TestMethod method to the event. Which two actions should you perform?()AAdd the following line of code to TestUserControl.ascx.cs. public event MyEventHandler MyEvent;BAdd the following line of code to TestUserControl.ascx.cs. public MyEventHandler MyEvent;CReplace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID=testControl runat=server OnMyEvent=TestMethod/DReplace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID=testControl runat=server MyEvent=TestMethod/
考题
单选题You need to write a multicast delegate that accepts a DateTime argument.Which code segment should you use?()A
public delegate int PowerDeviceOn(bool result,DateTime autoPowerOff);B
public delegate bool PowerDeviceOn(object sender,EventArgs autoPowerOff);C
public delegate void PowerDeviceOn(DateTime autoPowerOff);D
public delegate bool PowerDeviceOn(DateTime autoPowerOff);
考题
单选题You work as a Web Developer at Certkiller.com. You make use of Microsoft ASP.NET 3.5 in orderto create a Web Site. In a separate code file you create the following class: public static class _Colors { public static Color NormalActivityColor = Color.Green; public static Color WarningActivityColor = Color.Yellow; public static Color ErrorActivityColor = Color.Red; public static Color GetRandomColor() { Random random = new Random((int)DateTime.Now.Ticks); int randomArgbValue = random.Next(); Color color = Color.FromArgb(255, Color.FromArgb(randomArgbValue)); return color; } } You need to ensure that the class is consumed by the Web Site. You have to configure the WebSite project. What should you do?()A
You should add the file to the App_Code folder of the project.B
You should add a Register directive that will reference the file to every page that makes use ofthe class.C
This can be accomplished by referencing the file in the assemblies segment of the Web.configfile.D
This can be accomplished by referencing the file in the httpHandlers segment of the Web.configfile.
考题
单选题You are creating an ASP.NET Web site. You create a HTTP module named Custom Module, and you register the module in the web.config file.The Custom Module class contains the following code. Public Class Custom Module Implements IHttpModule Dim footerContent As String = Footer Content"Public Sub Dispose() Implements IHttpModule.DisposeEnd SubEnd Class You need to add code to CustomModule to append the footer content to each processed ASP.NET page. Which code segment should you use?()A
Public Sub New(ByVal app As HttpApplication) AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = TryCast(sender, HttpApplication) app.Response.Write(footerContent) End Sub B
Public Sub Init(ByVal app As HttpApplication) _ Implements IHttpModule.Init AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = New HttpApplication() app.Response.Write(footerContent) End Sub C
Public Sub New() Dim app As HttpApplication = New HttpApplication() AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = TryCast(sender, HttpApplication) app.Response.Write(footerContent) End Sub D
Public Sub Init(ByVal app As HttpApplication) _ Implements IHttpModule.Init AddHandler app.EndRequest, AddressOf app_EndRequest End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs) Dim app As HttpApplication = TryCast(sender, HttpApplication)app.Response.Write(footerContent) End Sub
考题
单选题You work as an application developer at Certkiller .com. You have been given the responsibility of creating a class named CalcSalary that will determine the salaries of Certkiller .com’s staff.The CalcSalary class includes methods to increment and decrement staff salaries.You would like to invoke the IncrementSalary and DecrementSalary methods dynamically at runtime from the sales manager application when needed. After viewing the information displayed in the exhibit, you decide to use the Salary delegate to invoke these methods. using System; public delegate boolSalary (Employee Emp, double Amount); public class CalcSalary { // for promotions public static bool IncrementSalary (Employee Emp, double Amount) { // implementation details } // for demotions public static bool DecrementSalary (Employee Emp, double Amount) { // implementation details } What code should you use?()A
AB
BC
CD
D
考题
单选题您需要编写可接受日期时间参数并返回一个布尔值,多路广播的委托。您应该使用哪个代码段?()A
public delegate int PowerDeviceOn(bool, DateTime);B
public delegate bool PowerDeviceOn(Object, EventArgs);C
public delegate void PowerDeviceOn(DateTime);D
public delegate bool PowerDeviceOn(DateTime);
热门标签
最新试卷