Top 20 free demo 70-505(CSharp) for IT specialist (21 to 40)

70-505(CSharp) Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library! Try it Free Today!

Get it now →

Product Description:
Exam Number/Code: 70-505(CSharp)
Exam name: TS: Microsoft .NET Framework 3.5, Windows Forms Application Development
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Free Certification Real IT 70-505(CSharp) Exam pdf Collection

Question No. 21

You are creating a Windows application by using the .NET Framework 3.5. You plan to create a form that might result in a timeconsuming operation. You use the QueueUserWorkItem method and a Label control named lblResult. You need to update the users by using the lblResult control when the process has completed the operation.

Which code segment should you use

A. private void DoWork(object myParameter)

{

// thread work

this.Invoke(new MethodInvoker(ReportProgress));

}

private void ReportProgress()

{

this.lblResult.Text = "Finished Thread";

}

B. private void DoWork(object myParameter)

{

// thread work

this.lblResult.Text = "Finished Thread";

}

C. private void DoWork(object myParameter)

{

// thread work

System.Threading.Monitor.Enter(this);

this.lblResult.Text = "Finished Thread";

System.Threading.Monitor.Exit(this);

}

D. private void DoWork(object myParameter)

{

// thread work

System.Threading.Monitor.TryEnter(this);

ReportProgress();

}

private void ReportProgress()

{

this.lblResult.Text = "Finished Thread";

}

Answer: A


Question No. 22

You are creating a Windows Forms application by using the .NET Framework 3.5. You create a new form in the application. You add a ContextMenuStrip control named ctxMenu to the form.

You have a userdefined class named CustomControl. You write the following code segment in the application. (Line numbers are included for reference only.)

01 CustomControl myControl = new CustomControl(); 02 You need to ensure that an instance of CustomControl is displayed on the form as a toplevel item of the ctxMenu control.

Which code segment should you add at line 02

A. ToolStripControlHost host = new ToolStripControlHost(myControl); ctxMenu.Items.Add(host);

B. ToolStripPanel panel = new ToolStripPanel();

panel.Controls.Add(myControl);

ctxMenu.Controls.Add(panel);

C. ToolStripContentPanel panel = new ToolStripContentPanel(); panel.Controls.Add(myControl);

ctxMenu.Controls.Add(panel);

D. ToolStripMenuItem menuItem = new ToolStripMenuItem(); ToolStripControlHost host = new ToolStripControlHost(myControl); menuItem.DropDownItems.Add(host);

ctxMenu.Items.Add(menuItem);

Answer: A


Question No. 23

You are creating a Windows Forms application for inventory management by using the .NET Framework 3.5.

The application provides a form that allows users to maintain stock balances.

The form has the following features:

A dataset named dsStockBalance to store the stock information A business component named scInventory

The scInventory component provides a method named Save. You need to ensure that only the modified stock balances of dsStockBalance are passed to the scInventory.Save method.

Which code segment should you use

A. If dsStockBalance.HasChanges() = True Then

dsStockBalance.AcceptChanges()

End If

dsUpdates = dsStockBalance.GetChanges()

scInventory.Save(dsStockBalance)

B. If dsStockBalance.HasChanges() = True Then

dsUpdates = dsStockBalance.GetChanges()

End If

dsStockBalance.AcceptChanges()

scInventory.Save(dsStockBalance)

C. If dsStockBalance.HasChanges() = True Then

dsStockBalance.AcceptChanges()

dsUpdates = dsStockBalance.GetChanges()

scInventory.Save(dsUpdates)

End If

D. If dsStockBalance.HasChanges() = True Then

dsUpdates = dsStockBalance.GetChanges()

dsStockBalance.AcceptChanges()

scInventory.Save(dsUpdates)

End If

Answer: D


Question No. 24

Rate your level of proficiency in deploying Windows Forms controls, including creating composite Windows Forms controls, creating custom Windows Forms controls, and extending existing controls.

A. Very high

B. High

C. Moderate

D. Low

E. Very low

Answer: A


Question No. 25

You are creating a Windows Forms application by using the .NET Framework 3.5. You write a code segment to connect to a Microsoft Access database and populate a DataSet. You need to ensure that the application meets the following requirements:

It displays all database exceptions.

It logs all other exceptions by using the LogExceptionToFile.

Which code segment should you use

A. try

{

categoryDataAdapter.Fill(dsCategory);

}

catch (SqlException ex)

{

MessageBox.Show(ex.Message, "Exception");

LogExceptionToFile(ex.Message);

}

B. try

{

categoryDataAdapter.Fill(dsCategory);

}

catch (SqlException ex)

{

MessageBox.Show(ex.Message, "Exception");

}

catch (Exception ex)

{

LogExceptionToFile(ex.Message);

}

C. try

{

categoryDataAdapter.Fill(dsCategory);

}

catch (OleDbException ex)

{

MessageBox.Show(ex.Message, "Exception");

}

catch (Exception ex)

{

LogExceptionToFile(ex.Message);

}

D. try

{

categoryDataAdapter.Fill(dsCategory);

}

catch (OleDbException ex)

{

MessageBox.Show(ex.Message, "Exception");

LogExceptionToFile(ex.Message);

}

Answer: C


Question No. 26

Which of the following software products would you consider yourself proficient in Select all that apply.

A. .NET Framework 2.0

B. .NET Framework 3.5

C. Visual Studio .NET 2008

D. Windows Forms

Answer: A


70-505(CSharp) dumps

Question No. 27

You are creating a Windows Forms application by using the .NET Framework 3.5.

You create a new form in your application.

You add 100 controls at run time in the Load event handler of the form. Users report that the form takes a long time to get displayed.

You need to improve the performance of the form.

What should you do

A. Call the InitLayout method of the form before adding all the controls.

Call the PerformLayout method of the form after adding all the controls.

B. Call the InitLayout method of the form before adding all the controls.

Call the ResumeLayout method of the form after adding all the controls.

C. Call the SuspendLayout method of the form before adding all the controls.

Call the PerformLayout method of the form after adding all the controls.

D. Call the SuspendLayout method of the form before adding all the controls.

Call the ResumeLayout method of the form after adding all the controls.

Answer: D


Question No. 28

Rate your level of proficiency in implementing printing and reporting functionality in Windows Forms applications, including managing the print process by using print dialogs, constructing print documents, enabling security features for printing in a Windows Forms application, and creating customized PrintPreview components.

A. Very high

B. High

C. Moderate

D. Low

E. Very low

Answer: A


Question No. 29

You are creating a Windows Forms application by using the .NET Framework 3.5. The application is configured to use rolebased security. You need to ensure that users can print reports only by selecting a printer from the printer dialog box. You want to achieve this goal by using the minimum level of permission.

Which code segment should you use

A. [System.Drawing.Printing.PrintingPermission

(System.Security.Permissions.SecurityAction.Demand, Level=System.Drawing.Printing.PrintingPermissionLevel.AllPrinting)]

B. [System.Drawing.Printing.PrintingPermission

(System.Security.Permissions.SecurityAction.Demand, Level=System.Drawing.Printing.PrintingPermissionLevel.NoPrinting)]

C. [System.Drawing.Printing.PrintingPermission

(System.Security.Permissions.SecurityAction.Demand, Level=System.Drawing.Printing.PrintingPermissionLevel.DefaultPrinting)]

D. [System.Drawing.Printing.PrintingPermission

(System.Security.Permissions.SecurityAction.Demand, Level=System.Drawing.Printing.PrintingPermissionLevel.SafePrinting)]

Answer: D


Question No. 30

You are creating a Windows Forms application by using the .NET Framework 3.5. You need to populate a list box control along with category names by using a DataReader control.

Which code segment should you use

A. Dim reader As OleDbDataReader

Dim cnnNorthwind As OleDbConnection = New _

OleDbConnection(connectionString)

cnnNorthwind.Open()

Dim cmdCategory As OleDbCommand = New _

OleDbCommand("SELECT * FROM Categories", cnnNorthwind) reader = cmdCategory.ExecuteReader()

While reader.Read()

lbCategories.Items.Add(reader("CategoryName"))

End While

cnnNorthwind.Close()

B. Dim reader As OleDbDataReader

Dim cnnNorthwind As OleDbConnection = New _

OleDbConnection(connectionString)

cnnNorthwind.Open()

Dim cmdCategory As OleDbCommand = New _

OleDbCommand("SELECT * FROM Orders", cnnNorthwind) reader = cmdCategory.ExecuteReader()

While reader.NextResult()

lbCategories.Items.Add(reader("CategoryName"))

End While

cnnNorthwind.Close()

C. Dim reader As OleDbDataReader

Dim cnnNorthwind As OleDbConnection = New _

OleDbConnection(connectionString)

cnnNorthwind.Open()

Dim cmdCategory As OleDbCommand = New _

OleDbCommand("SELECT * FROM Orders", cnnNorthwind) reader = cmdCategory.ExecuteReader()

cnnNorthwind.Close()

While reader.Read()

lbCategories.Items.Add(reader("CategoryName"))

End While

cnnNorthwind.Close()

D. Dim reader As OleDbDataReader

Using cnnNorthwind As OleDbConnection = New _

OleDbConnection(connectionString)

cnnNorthwind.Open()

Dim cmdCategory As OleDbCommand = New _

OleDbCommand("SELECT * FROM Orders", cnnNorthwind) reader = cmdCategory.ExecuteReader()

End Using

While reader.Read()

lbCategories.Items.Add(reader("CategoryName"))

End While

cnnNorthwind.Close()

Answer: A


Question No. 31

You create Windows Forms applications by using the .NET Framework 3.5. You create a new application for Windows Vista client computers. The application requires elevated access to read files from the local file system. You need to ensure that the application requires elevated permissions on execution.

What should you do

A. Create a new certificate trust list (CTL).

Use the CertMgr.exe tool to install the CTL on the local computer.

B. Create a new certificate trust list (CTL).

Install the CTL on the server that has the ClickOnce application published.

C. Create a manifest that includes the <requestedExecutionLevel level="asInvoker"/> tag.

Add the manifest to the executable file of the application.

D. Create a manifest that includes the <requestedExecutionLevel level="requireAdministrator"/> tag.

Add the manifest to the executable file of the application.

Answer: D


Question No. 32

You create Windows Forms applications by using the .NET Framework 3.5. You plan to deploy a new Windows Presentation Foundation (WPF) XAML browser application (XBAP).

The deployment must meet the following requirements:

A shortcut is added to the Start menu.

The most recent version of the application is installed and executed on client computers. Users can uninstall the application from the control panel. You need to identify a deployment technology that meets the specified requirements. You want to achieve this goal by using the minimum amount of development effort.

Which deployment technology should you use

A. XCOPY

B. ClickOnce

C. Microsoft Windows Installer

D. Remote Desktop connections

Answer: B


70-505(CSharp) book

Question No. 33

You are creating a Windows Forms application by using the .NET Framework 3.5. The application requires a form to display a clock. You need to create a circular form to display the clock.

Which code segment should you use

A. this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.None;

System.Drawing.Drawing2D.GraphicsPath path = new

System.Drawing.Drawing2D.GraphicsPath();

path.AddEllipse(0, 0, this.Width, this.Height);

Region reg = new Region();

this.Region = reg;

B. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; System.Drawing.Drawing2D.GraphicsPath path = new

System.Drawing.Drawing2D.GraphicsPath();

path.AddEllipse(0, 0, this.Width, this.Height);

Region reg = new Region(path);

this.Region = reg;

C. this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.None;

System.Drawing.Drawing2D.GraphicsPath path = new

System.Drawing.Drawing2D.GraphicsPath();

path.AddEllipse(0, 0, this.Width, this.Height);

Region reg = new Region(path);

this.Region = reg;

D. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; System.Drawing.Drawing2D.GraphicsPath path = new

System.Drawing.Drawing2D.GraphicsPath();

path.AddEllipse(0, 0, this.Width, this.Height);

Region reg = new Region();

this.Region = reg;

Answer: C


Question No. 34

Rate your level of proficiency in creating a Windows Forms setup application, setting appropriate security permissions to deploy the application, and configuring Trusted Application deployments and security features in an application.

A. Very high

B. High

C. Moderate

D. Low

E. Very low

Answer: A


Question No. 35

You are creating a Windows Forms application that has the print functionality by using the .NET Framework 3.5.

You implement the PrintPage page event for the form. You associate an instance of the PrintDocument control along with an instance of the PrintPreviewDialog control named prevDialog1.

You want to set the default size of the PrintPreviewDialog class to full screen. You need to provide a print preview for the user by adding a code segment to the Click event of the button on the form.

Which code segment should you use

A. prevDialog1.Width = Screen.PrimaryScreen.Bounds.Width; prevDialog1.Height = Screen.PrimaryScreen.Bounds.Height; prevDialog1.ShowDialog();

B. prevDialog1.Width = 1024;

prevDialog1.Height = 768;

prevDialog1.ShowDialog();

C. prevDialog1.Width = prevDialog1.PrintPreviewControl.Width; prevDialog1.Height = prevDialog1.PrintPreviewControl.Height; prevDialog1.ShowDialog();

D. prevDialog1.Width = prevDialog1.PrintPreviewControl.Width; prevDialog1.Height = prevDialog1.PrintPreviewControl.Height; prevDialog1.Update();

Answer: A


Question No. 36

Rate your level of proficiency in integrating data in Windows Forms applications, including implementing databound controls, managing connections and transactions, creating, adding, deleting, and editing data in connected and disconnected environments, and querying data from data sources by using LINQ.

A. Very high

B. High

C. Moderate

D. Low

E. Very low

Answer: A


Question No. 37

You are creating a Windows Forms application for a courier company by using the .NET Framework 3.5.

You create a form that allows customers to track the progress of their shipments.

The form contains the following elements:

A text box named txtTN that allows users to enter a tracking number An ErrorProvider control named ErrorProvider1 that informs users of an invalid tracking number

A function named ValidTrackingNumber that validates tracking numbers You need to ensure that the txtTN text box is validated.

Which code segment should you use

A. private void txtTN_Validating(object sender, CancelEventArgs e) {

if (!ValidTrackingNumber(txtTN.Text))

{

errorProvider1.SetError(txtTN, "Invalid Tracking

Number");

B. Cancel = true;

}

else

errorProvider1.SetError(txtTN, "");

}

C. private void txtTN_Validating(object sender, CancelEventArgs e) {

if (!ValidTrackingNumber(txtTN.Text))

errorProvider1.SetError(txtTN, "Invalid Tracking

Number");

else

{

errorProvider1.SetError(txtTN, "");

D. Cancel = true;

}

}

E. private void txtTN_Validated(object sender, EventArgs e) {

if (!ValidTrackingNumber(txtTN.Text))

errorProvider1.SetError(txtTN, "Invalid Tracking

Number");

else

{

errorProvider1.SetError(txtTN, "");

txtTN.Focus();

}

}

F. private void txtTN_Validated(object sender, EventArgs e) {

if (!ValidTrackingNumber(txtTN.Text))

{

errorProvider1.SetError(txtTN, "Invalid Tracking

Number");

txtTN.Focus();

}

else

errorProvider1.SetError(txtTN, "");

}

Answer: A


Question No. 38

You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a custom control for the application. The control will be a composite control.

Your need to derive from the class that will create the control by using the minimum amount of development effort.

What should you do

A. Derive from the Control class.

B. Derive from the UserControl class.

C. Derive from the FrameworkElement class.

D. Derive from the ContainerControl class.

Answer: B


Question No. 39

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:

It is not blocked when the delegate is running.

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.

Answer: C


Question No. 40

Rate your level of proficiency in managing XML by using the XML Document Object Model (DOM) and reading, writing, and validating XML by using the XmlReader and XmlWriter classes.

A. Very high

B. High

C. Moderate

D. Low

E. Very low

Answer: A