Microsoft UPGRADE: MCAD Skills to MCTS Web Apps Using MS.NET Framework Sample Questions:
1. You have just graduated from college, now you are serving the internship as the software developer in an international company. You are designing a .NET Framework 2.0 Web Application. You want the application to send messages by e-mail. There's an SMTP server which is named smtp.wikigo.com on the local subnet. You use a source address, [email protected], and [email protected], a target address, to test the application. In the options below, which code segment should you use to transmit the e-mail message?
A) Dim MailFrom As New MailAddress("[email protected]", "Me")Dim MailTo As New MailAddress("[email protected]", "You")Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject = "Greetings"Message.Body = "Test"Dim objClient As New SmtpClient("smtp.contoso.com")objClient.Send(Message)
B) Dim MailFrom As New MailAddress("[email protected]", "Me")Dim MailTo As New MailAddress("[email protected]", "You")Dim Message As New MailMessage(MailFrom, MailTo)Message.Subject = "Greetings"Message.Body = "Test"Message.Dispose()
C) Dim MailFrom As New MailAddress("[email protected]", "Me")Dim MailTo As New MailAddress("[email protected]", "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)
D) Dim SMTPClient As String = "smtp.contoso.com"Dim MailFrom As String = "[email protected]"Dim MailTo As String = "[email protected]"Dim Subject As String = "Greetings"Dim Body As String = "Test"Dim Message As New MailMessage(MailFrom, MailTo, Subject, SMTPClient)
2. You have just graduated from college, now you are serving the internship as the software developer in an international company. You need to add a string named strConn to the connection string section of the application configuration file. You plan to write a code segment to achieve this. So what code segment should you write?
A) Dim myConfig As Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None)myConfig.ConnectionStrings.ConnectionStrings.Add( _ New ConnectionStringSettings("ConnStr1", strConn))myConfig.Save()
B) ConfigurationManager.ConnectionStrings.Add( New ConnectionStringSettings("ConnStr1", strConn))Dim myConfig As Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None)myConfig.Save()
C) ConfigurationManager.ConnectionStrings.Add( _New ConnectionStringSettings("ConnStr1", strConn))ConfigurationManager.RefreshSection("ConnectionStrings")
D) Dim myConfig As Configuration = _ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None)myConfig.ConnectionStrings.ConnectionStrings.Add( _ New ConnectionStringSettings("ConnStr1", strConn))ConfigurationManager.RefreshSection("ConnectionStrings")
3. You have just graduated from college' now you are serving the internship as the software developer in an international company. According to the requirements of the company CIO, you create a master page named Template.master which contains the following ContentPlaceHolder server controls.
<asp:contentplaceholder id="area1" runat="server"/>
<asp:contentplaceholder id="area2" runat="server"/>
You also create 10 Web Forms which reference Template.master as their master page.
Each Web Form has the following Content controls that correspond to the ContentPlaceHolder controls in Template.master.
<asp:Content ContentPlaceHolderID="area1" Runat="Server"/>
<asp:Content ContentPlaceHolderID="area2" Runat="Server"/>
In order to make that whenever a Web Form does not provide that content, default content will be shown in the area2 ContentPlaceHolder control, you have to configure the Web pages.
What action should you perform?
A) You have to create an additional ContentPlaceHolder control in Template.master named area2_default. Then you should place default content inside area2_default and remove area2 from Web Forms that do not provide content.
B) You have move default content inside area2 in Template.master. Leave area2 blank in Web Forms that do not provide content.
C) You have move default content inside area2 in Template.master. Remove area2 from Web Forms that do not provide content.
D) You have move default content inside area2 in the Web Forms. Remove area2 from Template.master.
4. You have just graduated from college, now you are serving the internship as the software developer in an international company. According to the requirements of the company CIO, you create a Web Form which is for members only. The behavior of the Web site varies according to the role of the user. The Web site creates user accounts by using the ASP.NET Membership control. You have to identify whether a user is a member of a particular role. What should you do?
A) You should pass the user names to Membership.GetUser.
B) You should pass the role names to User.IsInRole.
C) You should pass the user names and passwords to Membership.ValidateUser.
D) You should pass the role names to Roles.RoleExists.
5. You have just graduated from college, now you are serving the internship as the software developer in an international company. According to the requirements of the company CIO, you are creating a custom-collection class. A method needs to be created in your class. You must make sure that the method you create returns a type. And the type should be compatible with the Foreach statement. Which criterion should the method meet?
A) The method must return a type of IComparable.
B) The method must return a type of either IEnumerator or IEnumerable.
C) The method must explicitly contain a collection.
D) The method must be the only iterator in the class.
Solutions:
| Question # 1 Answer: A | Question # 2 Answer: A | Question # 3 Answer: C | Question # 4 Answer: B | Question # 5 Answer: B |
We're so confident of our products that we provide no hassle product exchange.


By Lynn

