1. Question: 

    You are creating an application that retrieves values from a custom section of the application configuration file. The custom section uses XML as shown in the following block.

    <ProjectSection name="Project1">

    <role name="administrator" />

    <role name="manager" />

    <role name="support" />

    </ProjectSection>

    You need to write a code segment to define a class named Role. You need to ensure that the Role class is initialized with values that are retrieved from the custom section of the configuration file.

    Which code segment should you use?

    A
    Public Class Role
    Inherits ConfigurationElement
    Friend _ElementName As String = "role"
    Private _name As String
    <ConfigurationProperty("name")>_
    Public ReadOnly Property Name() As String
    Get
    Return _name
    End Get
    End Property
    End Class

    B
    Public Class Role
    Inherits ConfigurationElement
    Friend _ElementName As String = "name"
    Private _name As String
    <ConfigurationProperty("role", IsRequired:=True)> _
    Public ReadOnly Property Name() As String Get
    Return _name
    End Get
    End Property
    End Class

    C
    Public Class Role
    Inherits ConfigurationElement
    Friend _ElementName As String = "role"
    <ConfigurationProperty("name", IsRequired:=True)>_
    Public ReadOnly Property Name() As String Get
    Return CType(Me("name"), String)
    End Get
    End Property
    End Class

    D
    Public Class Role
    "A Composite Solution With Just One Click" - Certification Guaranteed 265 Microsoft 70-536 Exam
    Inherits ConfigurationElement
    Friend _ElementName As String = "name"
    <ConfigurationProperty("role")>_
    Public ReadOnly Property Name() As String
    Get
    Return CType(Me("role"), String)
    End Get
    End Property
    End Class

    Note: Not available
    1. Report
  2. Question: You are developing a custom-collection class. You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?

    A
    The method must explicitly contain a collection.

    B
    The method must return a type of either IEnumerator or IEnumerable.

    C
    The method must be the only iterator in the class.

    D
    The method must return a type of IComparable.

    Note: Not available
    1. Report
  3. Question: 

    You are developing an application that dynamically loads assemblies from an application directory. You need to write a code segment that loads an assembly named Assembly1.dll into the current application domain. Which code segment should you use?

    A
    AppDomain= domain = AppDomain::CurrentDomain;
    String= myPath = Path::Combine(domain->BaseDirectory, "Assembly1.dll");
    Assembly= assm = Assembly::LoadFrom(myPath);

    B
    AppDomain= domain = AppDomain::CurrentDomain;
    String= myPath = Path::Combine(domain->BaseDirectory, "Assembly1.dll");
    Assembly= assm = Assembly::Load(myPath);

    C
    AppDomain= domain = AppDomain::CurrentDomain;
    String= myPath = Path::Combine(domain->DynamicDirectory, "Assembly1.dll");
    Assembly= assm = AppDomain::CurrentDomain::Load(myPath);

    D
    AppDomain= domain = AppDomain::CurrentDomain;
    Assembly= assm = domain->GetData("Assembly1.dll");

    Note: Not available
    1. Report
  4. Question: 

    You are developing a method to encrypt sensitive data with the Data Encryption Standard (DES) algorithm. Your method accepts the following parameters:

    The byte array to be encrypted, which is named message

    An encryption key, which is named key

    An initialization vector, which is named iv

    You need to encrypt the data. You also need to write the encrypted data to a MemoryStream object.

    Which code segment should you use?

    A
    DES= des = gcnew DESCryptoServiceProvider();
    des->BlockSize = message->Length;
    ICryptoTransform= crypto = des->CreateEncryptor(key, iv); MemoryStream =cipherStream = gcnew MemoryStream();
    CryptoStream =cryptoStream = gcnew CryptoStream(cipherStream,crypto, CryptoStreamMode::Write);
    cryptoStream->Write(message, 0, message->Length);

    B
    DES =des = gcnew DESCryptoServiceProvider();
    ICryptoTransform =crypto = des->CreateEncryptor(key, iv); MemoryStream =cipherStream = gcnew MemoryStream();
    CryptoStream =cryptoStream = gcnew CryptoStream(cipherStream, crypto, CryptoStreamMode::Write);
    cryptoStream->Write(message, 0, message->Length);

    C
    DES =des = gcnew DESCryptoServiceProvider();
    ICryptoTransform= crypto = des->CreateEncryptor();
    MemoryStream =cipherStream = gcnew MemoryStream();
    CryptoStream =cryptoStream = gcnew CryptoStream(cipherStream, crypto, CryptoStreamMode::Write);
    cryptoStream->Write(message, 0, message->Length);

    D
    DES =des = gcnew DESCryptoServiceProvider();
    ICryptoTransform =crypto = des->CreateDecryptor(key, iv); MemoryStream =cipherStream = gcnew
    MemoryStream();
    CryptoStream =cryptoStream = gcnew CryptoStream(cipherStream, crypto, CryptoStreamMode::Write);
    cryptoStream->Write(message, 0, message->Length);

    Note: Not available
    1. Report
  5. Question: You are loading a new assembly into an application. You need to override the default evidence for the assembly. You require the common language runtime (CLR) to grant the assembly a permission set, as if the assembly were loaded from the local intranet zone. You need to build the evidence collection. Which code segment should you use?

    A
    Evidence evidence = new Evidence();
    evidence.AddHost(new Zone(SecurityZone.Intranet));

    B
    Evidence evidence = new Evidence(
    AppDomain.CurrentDomain.Evidence
    );

    C
    Evidence evidence = new Evidence();
    evidence.AddAssembly(new Zone(SecurityZone.Intranet));

    D
    Evidence evidence = new Evidence(
    Assembly.GetExecutingAssembly().Evidence );

    Note: Not available
    1. Report
  6. Question: You are changing the security settings of a file named MyData.xml. You need to preserve the existing inherited access rules. You also need to prevent the access rules from inheriting changes in the future. Which code segment should you use?

    A
    FileSecurity security = new FileSecurity("mydata.xml", AccessControlSections.All); security.SetAccessRuleProtection(true, true);
    File.SetAccessControl("mydata.xml", security);

    B
    FileSecurity security = new FileSecurity();
    security.SetAccessRuleProtection(true, true);
    File.SetAccessControl("mydata.xml", security);

    C
    FileSecurity security = File.GetAccessControl("mydata.xml");  security.SetAccessRuleProtection(true, true);

    D
    FileSecurity security = File.GetAccessControl("mydata.xml"); security.SetAuditRuleProtection(true, true); File.SetAccessControl("mydata.xml", security);

    Note: Not available
    1. Report
  7. Question: You create an application that stores information about your customers who reside in various regions. You are developing internal utilities for this application. You need to gather regional information about your customers in Canada. Which code segment should you use?

    A
    RegionInfo regionInfo = new RegionInfo("");
    if (regionInfo.Name == "CA") {
    // Output the region information...
    }

    B
    foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) {
    // Output the
    region information...
    }

    C
    CultureInfo cultureInfo = new CultureInfo("CA");
    // Output the region information...

    D
    RegionInfo regionInfo = new RegionInfo("CA");
    // Output the region information...

    Note: Not available
    1. Report
  8. Question: You are changing the security settings of a file named MyData.xml. You need to preserve the existing inherited access rules. You also need to prevent the access rules from inheriting changes in the future. Which code segment should you use?

    A
    FileSecurity= security = gcnew FileSecurity("mydata.xml",AccessControlSections::All); security->SetAccessRuleProtection(true, true);
    File::SetAccessControl("mydata.xml", security);

    B
    FileSecurity= security = File::GetAccessControl("mydata.xml"); security->SetAuditRuleProtection(true, true);
    File::SetAccessControl("mydata.xml", security);

    C
    FileSecurity= security = File::GetAccessControl("mydata.xml"); security->SetAccessRuleProtection(true, true);

    D
    FileSecurity= security = gcnew FileSecurity();
    security->SetAccessRuleProtection(true, true);
    File::SetAccessControl("mydata.xml", security);

    Note: Not available
    1. Report
  9. Question: 

    You write a class named Employee that includes the following code segment.

    public ref class Employee

    {

    String= employeeId;

    String= employeeName;

    String= jobTitleName;

    public:

    String= GetName() { return employeeName; }

    String= GetJobTitle() { return jobTitleName; }

    You need to expose this class to COM in a type library. The COM interface must also facilitate forward-compatibility across new versions of the Employee class.

    You need to choose a method for generating the COM interface.

    What should you do?

    A
    Add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType::AutoDual)]
    public class Employee {

    B
    Add the following attribute to the class definition.
    [ComVisible(true)]
    public class Employee {

    C
    Add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType::None)]
    public class Employee {

    D
    Define an interface for the class and add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType::None)]
    public class Employee : IEmployee {

    Note: Not available
    1. Report
  10. Question: 

    You are using the Microsoft Visual Studio 2005 IDE to examine the output of a method that returns a string. You assign the output of the method to a string variable named fName.

    You need to write a code segment that prints the following on a single line

    The message: "Test Failed: "

    The value of fName if the value of fName does not equal "John"

    You also need to ensure that the code segment simultaneously facilitates uninterrupted execution of the application.

    Which code segment should you use?

    A
    Debug::WriteLineIf(fName != "John", fName, "Test Failed");

    B
    Debug::Assert(fName == "John", "Test Failed: ", fName);

    C
    if (fName != "John") {
    Debug::Print("Test Failed: ");
    Debug::Print(fName);
    }

    D
    if (fName != "John") {
    Debug::WriteLine("Test Failed: ");
    Debug::WriteLine(fName);
    }

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd