Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Microsoft 70-540(VB) Exam - Cheat-Test.com

Free 70-540(VB) Sample Questions:

Q: 1 You create a Microsoft .NET Compact Framework application for Microsoft Windows Mobilebased devices.
You need to create a deployment package for the Windows Mobilebased application.
What should you do?
A. In the main Microsoft Visual Studio 2005 solution for the application, add a Smart Device CAB project.
Add the primary output of the Smart Device project to the Smart Device CAB project.
B. In the main Microsoft Visual Studio 2005 solution for the application, add a CAB project. Add the primary output of the Smart Device project to the CAB project.
C. Create an empty text file named App.CAB. Add it to the Smart Device project and set the Build Action property for the App.CAB file to Content.
D. Run the Cabwiz.exe file and reference the Microsoft Visual Studio 2005 solution for the application.
Answer: A

Q: 2 You are creating a Microsoft Windows Mobilebased animation application.
You create a disposable class named UnmanagedResource to manage drawing operations on the screen.
You create a static method in the UnmanagedResource class named LoadResource that loads unmanaged resources.
You must release all the unmanaged resources when the following situations arise:
You finish using all the unmanaged resources.
An exception occurs when you use the UnmanagedResource class.
You need to identify the code segment that meets the outlined requirements.
Which code segment should you use?
A. Using ur As UnmanagedResource = UnmanagedResource.LoadResource()
...
End Using
B. Dim ur As UnmanagedResource = UnmanagedResource.LoadResource()
Using ur
...
End Using
C. Dim ur As UnmanagedResource = UnmanagedResource.LoadResource()
Try
...
Finally
ur.Dispose()
End Try
D. Dim ur As UnmanagedResource = UnmanagedResource.LoadResource()
Try
...
Catch
ur.Dispose()
End Try
Answer: A

Q: 3 You are creating a Microsoft Windows Mobilebased application by using Microsoft .NET Compact Framework 2.0.
The Windows Mobilebased application will be deployed to multiple Windows Mobile device platforms.
You open Device Emulator Manager and attempt to access the emulators for the devices. You discover that the emulators are closed.
You need to ensure that you can test the application for each device platform.
What should you do?
A. Restore an image for each device emulator.
B. Connect to each device emulator.
C. Cradle each device emulator.
D. Reset each device emulator.
Answer: B

Q: 4 You create a Microsoft Windows Mobilebased application that retrieves data from a Web service.
You test the Windows Mobilebased application in a Windows Mobile 5.0 emulator. The application fails to connect to the Web service. You discover that Microsoft ActiveSync is not installed on the desktop computer.
You need to ensure that the application connects to the Web service from the emulator.
Which two tasks should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Install Microsoft Web Services Enhancements 3.0.
B. Install the Microsoft Virtual Machine Network Services driver for the emulator.
C. Configure the TCP settings for the emulator to use TCP Connect Transport and configure the emulator to use a static IP address.
D. Configure the connection settings to allow DMA connections.
E. Configure the connection settings to connect the computer to the Internet.
Answer: B, C

Q: 5 You create a Microsoft Windows Mobilebased application.
You need to enable performance counters and logging for the application and log the information to a separate file.
What should you do?
A. Rebuild the application by using the /log:filename command option.
B. Use the Devenv command to specify the log file for the application.
C. Create an instance of the TraceListener class in the application.
D. Set the HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\UseApp registry key to 1.
Answer: D

Q: 6 You create a Microsoft .NET Compact Framework assembly for Microsoft Windows Mobilebased devices.
All assemblies must be strong named. The key pair file is named ContosoKeyPair.snk.
You need to ensure that the outlined requirement is met by using Microsoft Visual Studio 2005.
What should you do?
A. Authenticode sign the assembly with the ContosoKeyPair.snk file.
B. Add the ContosoKeyPair.snk file to the project, and set the Build Action property to Embedded Resource.
C. Set the AssemblyKeyFile property to the location of the ContosoKeyPair.snk file.
D. Add the ContosoKeyPair.snk file to the project, and set the Build Action property to Content.
Answer: C

Q: 7 You are creating a Microsoft Windows Mobilebased application. The application will allow users to send e-mail messages to support@contoso.com.
The txtEmail text box control contains the e-mail message to be sent.
You need to send the e-mail message by using an existing e-mail account.
Which code segment should you use?
A. Private Sub btnSendEmail_ClickA_InCorrect( _
ByVal sender As Object, ByVal e As EventArgs)
Dim message As New EmailMessage
message.BodyText = Me.txtEmail.Text
message.Send("support@contosso.com")
End Sub
B. Private Sub btnSendEmail_ClickB_InCorrect( _
ByVal sender As Object, ByVal e As EventArgs)
Dim session As New OutlookSession
Dim mailAccount As EmailAccount = session.EmailAccounts(0)
Dim message As New EmailMessage
message.BodyText = Me.txtEmail.Text
message.Send("support@contosso.com")
End Sub
C. Private Sub btnSendEmail_ClickC_Correct( _
ByVal sender As Object, ByVal e As EventArgs)
Dim session As New OutlookSession
Dim mailAccount As EmailAccount = session.EmailAccounts(0)
Dim message As New EmailMessage
message.BodyText = Me.txtEmail.Text
message.To.Add(New Recipient("support@contosso.com"))
message.Send(mailAccount)
End Sub
D. Private Sub btnSendEmail_ClickD_InCorrect( _
ByVal sender As Object, ByVal e As EventArgs)
Dim message As New EmailMessage
message.BodyText = Me.txtEmail.Text
message.To.Add(New Recipient("support@contosso.com"))
message.Send(message.From.Address)
End Sub
Answer: C

Q: 8 You are creating a Microsoft Windows Mobilebased application. The application must receive Windows messages from a native application.
You write the following code segment.
Public Class MsgWin
Inherits MessageWindow
Private Const WM_APP As Integer = &H800
Public MessageReceived As EventHandler
End Class
You need to add code to the MsgWin class to ensure that the application raises the MessageReceived
event when a WM_APP message is received.
Which code segment should you use?
A. Protected Overrides Sub WndProc(ByRef m As Message)
If Not m.Msg = WM_APP Then
If Not MessageReceived Is Nothing Then
MessageReceived(Me, Nothing)
End If
End If
MyBase.WndProc(m)
End Sub
B. Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_APP Then
If Not MessageReceived Is Nothing Then
MessageReceived(Me, Nothing)
End If
End If
MyBase.WndProc(m)
End Sub
C. Protected Overrides Sub WndProc(ByRef m As Message)
If m.Result = CType(WM_APP, IntPtr) Then
If Not MessageReceived Is Nothing Then
MessageReceived(Me, Nothing)
End If
End If
MyBase.WndProc(m)
End Sub
D. Protected Overrides Sub WndProc(ByRef m As Message)
If m.LParam = CType(WM_APP, IntPtr) Then
If Not MessageReceived Is Nothing Then
MessageReceived(Me, Nothing)
End If
End If
MyBase.WndProc(m)
End Sub
Answer: B

Q: 9 You are creating a Microsoft Windows Mobilebased application. The application will present a Notification bubble after finishing a long-running process in a separate thread.
You write the following code.
Dim notify As New Microsoft.WindowsCE.Forms.Notification()
Dim text As String = _
"<html><body><form method='GET' action=notify>"
text += "<SELECT NAME='list'>"
text += "<OPTION VALUE='0'>Start now</OPTION>"
text += "<OPTION VALUE='1'>Postpone</OPTION>"
text += "</SELECT>"
text += "<input type=submit >"
text += "</body></html>"
notify.Text = text
AddHandler notify.ResponseSubmitted, _
AddressOf notify_ResponseSubmitted
The notify_ResponseSubmitted event handler must meet the following requirements:
Identify the selection in the drop-down list box.
Either display the DataDetailsForm form immediately or temporarily hide the Notification bubble and display a Notification icon on the title bar.
You need to write the code segment to meet the outlined requirements.
Which code segment should you use?
A. Dim choice As Integer = _ Convert.ToInt32(e.Response.Substring(12, 1))
If choice = 1 Then
notify.Visible = False
Dim form As New DataDetailsForm()
form.Show()
Else
notify.InitialDuration = 0
notify.Visible = True
End If.
B. Dim choice As Integer = _ Convert.ToInt32(e.Response.Substring(12, 1))
If choice = 0 Then
notify.Visible = False
Dim form As New DataDetailsForm()
form.Show()
Else
notify.InitialDuration = 0
notify.Visible = True
End If
C. Dim choice As Integer = _ Convert.ToInt32(e.Response.Substring(12, 1))
If choice = 0 Then
notify.Visible = True
Dim form As New DataDetailsForm()
form.Show()
Else
notify.InitialDuration = 10
notify.Visible = False
End If
D. Dim choice As Integer = _ Convert.ToInt32(e.Response.Substring(12, 1))
If choice = 1 Then
Dim form As New DataDetailsForm()
form.Show()
Else
notify.InitialDuration = 0
End If
Answer: B

Q: 10 You are creating an application for Microsoft Windows Mobilebased devices. The application contains a Windows Form. The form contains a private variable named state of the type SystemState.
You need to retrieve the phone number of an incoming call when the phone rings.
Which two tasks should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Write the following code segment in the constructor of the form.
state = New SystemState(SystemProperty.PhoneIncomingCallerContact)
AddHandler state.Changed, AddressOf state_Changed
B. Write the following code segment in the constructor of the form.
state = New SystemState(SystemProperty.PhoneIncomingCallerNumber)
AddHandler state.Changed, AddressOf state_Changed
C. Write the following code segment in the constructor of the form.
state = New SystemState(SystemProperty.PhoneTalkingCallerContact)
AddHandler state.Changed, AddressOf state_Changed
D. Write the following code segment in the constructor of the form.
state = New SystemState(SystemProperty.PhoneTalkingCallerNumber)
AddHandler state.Changed, AddressOf state_Changed
E. Add the following event handler in the form.
Sub state_Changed( _
ByVal sender As Object, ByVal args As ChangeEventArgs)
Dim mContact As Contact = CType(args.NewValue, Contact)
Dim number As String = mContact.MobileTelephoneNumber
End Sub
F. Add the following event handler in the form.
Sub state_Changed( _
ByVal sender As Object, ByVal args As ChangeEventArgs)
Dim number As String = args.NewValue.ToString()
End Sub
Answer: B, F

Q: 11 You create a Microsoft .NET Compact Framework application that interoperates with a native DLL.
The application calls the Microsoft Win32 EnumWindows API.
The native definition for EnumWindows contains the following code segment.
BOOL EnumWindows (
WNDENUMPROC lpEnumFunc ,
LPARAM lParam ;
)
The native definition for WNDENUMPROC contains the following code segment.
BOOL CALLBACK EnumWindowsProc (
HWND hwnd ,
LPARAM lParam ;
)
The Platform Invoke definition contains the following code segment.
<DllImport("Core.dll", SetLastError:=True)> _
Public Shared Function EnumWindows( _
ByVal lpEnumFunc As IntPtr, ByVal lParam As UInteger) As Boolean
End Function
The managed callback definition contains the following code segment.
Public Function EnumWindowsCallbackProc( _
ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
System.Diagnostics.Debug.WriteLine( _
("Window: " + hwnd.ToString()))
Return 1
End Function
You need to write a managed function that calls the native API.
Which code segment should you use?Reset Instructions Calculator.
A. Public Delegate Function EnumWindowsProc(ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
Public Sub InitializeCallback()
Dim callbackDelegate As New EnumWindowsProc( _
AddressOf EnumWindowsCallbackProc)
Dim callbackDelegatePointer As IntPtr = _
Marshal.GetFunctionPointerForDelegate(callbackDelegate)
EnumWindows(callbackDelegatePointer, 0)
End Sub
B. Public Delegate Function EnumWindowsProc( _
ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
Public Sub InitializeCallback()
Dim callbackDelegate As New EnumWindowsProc( _
AddressOf EnumWindowsCallbackProc)
Dim callbackDelegatePointer As IntPtr = _
Marshal.GetIDispatchForObject(callbackDelegate)
EnumWindows(callbackDelegatePointer, 0)
End Sub
C. Public Delegate Function EnumWindowsProc( _
ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
Public Sub InitializeCallback()
Dim callbackDelegatePointer As IntPtr = _
Marshal.GetFunctionPointerForDelegate( _
CType(AddressOf EnumWindowsCallbackProc, EnumWindowsProc))
EnumWindows(callbackDelegatePointer, 0)
End Sub
D. Private callbackWindow As New _ Microsoft.WindowsCE.Forms.MessageWindow()
Public Delegate Function EnumWindowsProc( _
ByVal hwnd As IntPtr, ByVal lParam As IntPtr) As Integer
Public Sub InitializeCallbackD()
Dim callbackDelegate As New EnumWindowsProc( _
AddressOf EnumWindowsCallbackProc)
callbackDelegate.Invoke(callbackWindow.Hwnd, IntPtr.Zero)
End Sub
Answer: A

Q: 12 You are creating a Microsoft .NET Compact Framework application that will interoperate with a native DLL.
The GetData function defined in the native DLL contains the following code segment.
typedef struct DATA_STRUCT {
DWORD id;
WORD data1;
WORD data2;
}
DATA_STRUCT;
extern "C"
__ declspec ( dllexport ) void GetData (DATA_STRUCT * pData );
You need to call the native GetData function.
What are two possible ways to achieve this goal? (Each correct answer presents a complete solution.
Choose two.)
A. Public Class DATA_STRUCT
Public id As UInteger
Public data1 As UShort
Public data2 As UShort
End Class
<DllImport("NativeDll.dll")> _
Private Shared Sub GetData(ByVal data As DATA_STRUCT)
End Sub
B. Public Structure DATA_STRUCT
Public id As UInteger
Public data1 As UShort
Public data2 As UShort
End Structure
<DllImport("NativeDll.dll")> _
Private Shared Sub GetData(ByRef data As DATA_STRUCT)
End Sub
C. Public Class DATA_STRUCT
Public id As UInteger
Public data1 As UShort
Public data2 As UShort
End Class
<DllImport("NativeDll.dll")> _
Private Shared Sub GetData(ByRef data As DATA_STRUCT)
End Sub
D. Public Structure DATA_STRUCT
Public id As UInteger
Public data1 As UShort
Public data2 As UShort
End Structure
<DllImport("NativeDll.dll")> _
Private Shared Sub GetData(ByVal data As DATA_STRUCT)
End Sub
Answer: A, B

Q: 13 You are creating a Microsoft .NET Compact Framework application.
The application must use an existing native COM interface named IOrders and an enumeration named OrderStatus. The interface and the enumeration are in the Orders.tlb file.
You need to import the Orders.tlb file into the application.
What should you do?
A. Create managed definitions of the IOrders interface and the OrderStatus enumeration by executing the Type Library Importer (tlbimp.exe) file that uses the Orders.tlb file as a command-line parameter. Add a reference to the resulting assembly in the Microsoft Visual Studio 2005 project for the application.
B. Add the Orders.tlb file to the Microsoft Visual Studio 2005 project for the application. On the File menu, select the Properties option, and then set the Build Action property to the Embedded Resource enumeration.
C. Rewrite the IOrders interface and the OrderStatus enumeration into a managed code assembly. Add a reference to the resulting assembly in the Microsoft Visual Studio 2005 project for the application.
D. Add a reference to the native DLL in the Microsoft Visual Studio 2005 project for the application.
Answer: A

Q: 14 You are creating a Microsoft Windows Mobilebased retail application. The application relays order requests to consuming applications. Each consuming application uses a different
format for element names.
The application contains a class named XmlTransmitter that writes the order request to each consuming application. The XmlTransmitter class is derived from the XmlTextWriter class.
You need to dynamically change the names of the XML elements when order requests are transmitted to the consuming application.
What should you do?
A. Override the WriteStartElement method of the XmlTextWriter class.
B. Override the WriteEndElement method of the XmlTextWriter class.
C. Override the WriteAttributes method of the XmlTextWriter class.
D. Override the WriteQualifiedName method of the XmlTextWriter class.
Answer: A

Q: 15 You are creating an application for a Microsoft Windows Mobilebased device. The application code includes a DataSet object. The DataSet object contains two DataTable objects named Customer and Order.
You must retrieve the most recent copy of all Order records in the DataSet object that meet the following requirements:
Order placed by the customer that has the CustomerID value 5.
Order changed or deleted after the last update in the DataSet object is saved.
You need to write the code segment that meets the outlined requirements.
Which code segment should you use?
A. Dim modRows As DataRow () = orderTable.Select _
(" CustomerID = 5", "", DataViewRowState.Deleted Or _
DataViewRowState.ModifiedCurrent )
B. Dim modRows As DataRow () = orderTable.Select _
(" CustomerID = 5", "", DataViewRowState.Deleted And _
DataViewRowState.ModifiedOriginal )
C. Dim modRows As DataRow () = orderTable.Select _
(" CustomerID = 5", "", DataViewRowState.Deleted )
D. Dim modRows As DataRow () = orderTable.Select _
(" CustomerID = 5", "", DataViewRowState.Deleted Or _
DataViewRowState.ModifiedOriginal )
Answer: A

Q: 16 You are creating a Microsoft Windows Mobilebased application.
You write the following code segment.
Private customerDataSet As DataSet = New DataSet (" customerData ")
Private ordersDataTable As DataTable = New DataTable("Orders")
Public Sub New()
InitializeComponent ()
Me.ordersDataTable.Columns.Add (" OrderID ", GetType(Integer))
Me.ordersDataTable.Columns.Add ("Total", GetType (Integer))
customerDataSet.Tables.Add ( ordersDataTable )
End Sub
You need to retrieve rows from the Orders data table by OrderID.
Which code segment should you use?
A. Public Function GetOrderTableData _
( ByVal orderID As Integer) As DataRow
Dim dataRows As DataRow () = _
Me.ordersDataTable.Select (" OrderID = " + orderID.ToString ())
If dataRows.Length > 0 Then
Return dataRows (0)
Else
Return Nothing
End If
End Function
B. Public Function GetOrderTableData _
( ByVal orderID As Integer) As DataRow
Return Me.ordersDataTable.Rows ( orderID )
End Function
C. Public Function GetOrderTableData _
( ByVal orderID As Integer) As DataRow
Return Me.ordersDataTable.Rows.Find ( orderID )
End Function
D. Public Function GetOrderTableData _
( ByVal orderID As Integer) As DataRow
Return CType ( Me.ordersDataTable.Compute ("select * from Orders", _
" OrderID = " + orderID.ToString ()), DataRow )
End Function
Answer: A

Q: 17 You are creating a Microsoft Windows Mobilebased application.
The application contains a Windows Form named Form1. You write the following code segment inside the Form1 class definition.
Public Sub New()
InitializeComponent ()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As _
System.EventArgs ) Handles MyBase.Load
Dim directoryInfo As DirectoryInfo = New _
DirectoryInfo ("\Temp\ MyApp ")
directoryInfo.Create ()
End Sub
You need to delete the Temp directory when the form is closed.
Which code segment should you use?
A. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs ) Handles MyBase.Closing
Dim directoryInfo As DirectoryInfo = New DirectoryInfo ("\Temp")
directoryInfo.Delete (True)
End Sub
B. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs ) Handles MyBase.Closing
Dim directoryInfo As DirectoryInfo = New DirectoryInfo ("\Temp")
Directory.Delete ( directoryInfo.FullName )
End Sub
C. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs ) Handles MyBase.Closing
Dim directoryInfo As DirectoryInfo = New DirectoryInfo ("\Temp")
directoryInfo.Delete (False)
End Sub
D. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs ) Handles MyBase.Closing
Dim directoryInfo As DirectoryInfo = New DirectoryInfo ("\Temp")
directoryInfo.Delete ()
End Sub
Answer: A

Q: 18 You are creating a Microsoft Windows Mobilebased application.
The application will allow users to input data into a text box named txtUserData.
You need to store the input data in a text file named Data.txt by using the FileStream class. You also need to ensure that the existing data in the Data.txt file is retained.
Which code segment should you use?
A. Dim path As String = "\MyApp\Data.txt"
Dim fileStream As FileStream = New FileStream _
(path, FileMode.CreateNew , FileAccess.Write )
Dim buffer As Byte() = Encoding.UTF8.GetBytes(txtUserData.Text)
fileStream.Write(buffer, 0, buffer.Length)
fileStream.Close()
B. Dim path As String = "\MyApp\Data.txt"
Dim fileStream As FileStream = New FileStream _
(path, FileMode.Create, FileAccess.Write )
Dim buffer As Byte() = Encoding.UTF8.GetBytes(txtUserData.Text)
fileStream.Write(buffer, 0, buffer.Length)
fileStream.Close()
C. Dim path As String = "\MyApp\Data.txt"
Dim fileStream As FileStream = New FileStream _
(path, FileMode.Append , FileAccess.Write )
Dim buffer As Byte() = Encoding.UTF8.GetBytes(txtUserData.Text)
fileStream.Write(buffer, 0, buffer.Length)
fileStream.Close()
D. Dim path As String = "\MyApp\Data.txt"
Dim fileStream As FileStream = New FileStream _
(path, FileMode.Truncate , FileAccess.Write )
Dim buffer As Byte() = Encoding.UTF8.GetBytes(txtUserData.Text)
fileStream.Write(buffer, 0, buffer.Length)
fileStream.Close()
Answer: C

Q: 19 You are creating a Microsoft Windows Mobilebased application that formats XML streams. You use the StringWriter class to receive XML streams.
You need to write a method named AppendNewLineToWriter that inserts new line characters at the end of the XML stream and returns the resulting string.
Which code segment should you use?
A. Public Function AppendNewLineToWriter _
( ByVal sw As StringWriter ) As String
Dim str As String = sw.ToString ()
Return str.Insert ( sw.GetStringBuilder ().Capacity - 1, _
ControlChars.Cr + ControlChars.Lf )
End Function
B. Public Function AppendNewLineToWriter _
( ByVal sw As StringWriter ) As String
Return sw.NewLine = ControlChars.Cr + ControlChars.Lf
End Function
C. Public Function AppendNewLineToWriter _
( ByVal sw As StringWriter ) As String
Dim sb As StringBuilder = sw.GetStringBuilder ()
Return sb.Insert ( sb.Capacity , ControlChars.Cr + _
ControlChars.Lf ). ToString ()
End Function
D. Public Function AppendNewLineToWriter_Correct _
( ByVal sw As StringWriter ) As String
sw.WriteLine ()
Return sw.ToString ()
End Function
Answer: D

Q: 20 You are creating a Microsoft Windows Mobilebased application.
The application contains two XML documents. The XML schemas for the two documents are different.
You need to merge the documents into a single XML document by using a method of the XMLDocument class.
Which method should you use?
A. AppendChild
B. ImportNode
C. CreateNode
D. CloneNode
Answer: B


© 2014 Cheat-Test.com, All Rights Reserved