1. Question: You are creating a new security policy for an application domain. You write the following lines of code.
    PolicyLevel =policy = PolicyLevel::CreateAppDomainLevel();
    PolicyStatement =noTrustStatement =
    gcnew PolicyStatement(
    policy->GetNamedPermissionSet("Nothing"));
    PolicyStatement =fullTrustStatement =
    gcnew PolicyStatement(
    policy->GetNamedPermissionSet("FullTrust"));
    You need to arrange code groups for the policy so that loaded assemblies default to the Nothing permission set. If the assembly originates from a trusted zone, the security policy must grant the assembly the FullTrust permission set.
    Which code segment should you use?

    A
    CodeGroup =group1 = gcnew FirstMatchCodeGroup(
    gcnew ZoneMembershipCondition(SecurityZone::Trusted), fullTrustStatement);
    CodeGroup =group2 = gcnew UnionCodeGroup(
    gcnew AllMembershipCondition(),
    noTrustStatement);
    group1->AddChild(group2);

    B
    CodeGroup =group = gcnew FirstMatchCodeGroup(
    gcnew AllMembershipCondition(),
    noTrustStatement);

    C
    CodeGroup =group = gcnew UnionCodeGroup(
    gcnew ZoneMembershipCondition(SecurityZone::Trusted), fullTrustStatement);

    D
    CodeGroup =group1 = gcnew FirstMatchCodeGroup(
    gcnew AllMembershipCondition(),
    noTrustStatement);
    CodeGroup =group2 = gcnew UnionCodeGroup(
    gcnew ZoneMembershipCondition(SecurityZone::Trusted), fullTrustStatement);
    group1->AddChild(group2);

    Note: Not available
    1. Report
  2. 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
    for each (CultureInfo= culture in CultureInfo::GetCultures(CultureTypes::SpecificCultures)) { // Output the region information...
    }

    B
    CultureInfo= cultureInfo = gcnew CultureInfo("CA");
     // Output the region information...

    C
    RegionInfo= regionInfo = gcnew RegionInfo("");
    if (regionInfo->Name == "CA") {
    // Output the region information...
    }

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

    Note: Not available
    1. Report
  3. Question: You are creating an assembly named Assembly1. Assembly1 contains a public method. The global cache contains a second assembly named Assembly2. You must ensure that the public method is only called from Assembly2. Which permission class should you use?

    A
    GacIdentityPermission

    B
    StrongNameIdentityPermission

    C
    DataProtectionPermission

    D
    PublisherIdentityPermission

    Note: Not available
    1. Report
  4. Question: You need to create a class definition that is interoperable along with COM. You need to ensure that COM applications can create instances of the class and can call the GetAddress method. Which code segment should you use?

    A
    Public Class Customer Shared m_AddressString As String Public Sub New() End Sub Public Shared Function GetAddress() As String  Return m_AddressString End Function End Class

    B
    Public Class Customer Private m_AddressString As String Public Sub New() End Sub Private Function GetAddress() As String Return m_AddressString End Function End Class

    C
    Public Class Customer Private m_AddressString As String Public Sub New(ByVal Address As String) m_AddressString = Address End Sub Public Function GetAddress() As String Return m_AddressString End Function End Class

    D
    Public Class Customer Private m_AddressString As String Public Sub New() End Sub Public Function GetAddress() As String Return m_AddressString End Function End Class

    Note: Not available
    1. Report
  5. Question: You are testing a method that examines a running process. This method returns an ArrayList containing the name and full path of all modules that are loaded by the process. You need to list the modules loaded by a process named C:\TestApps\Process1.exe. Which code segment should you use?

    A
    ArrayList ar = new ArrayList();
    Process[] procs;
    ProcessModuleCollection modules;
    procs = Process.GetProcesses(@"Process1");
    "A Composite Solution With Just One Click" - Certification Guaranteed 241 Microsoft 70-536 Exam
    if (procs.Length > 0) {
    modules = procs[0].Modules
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.ModuleName);
    }
    }

    B
    ArrayList ar = new ArrayList();
    Process[] procs;
    ProcessModuleCollection modules;
    procs = Process.GetProcessesByName(@"Process1");
    if (procs.Length > 0) {
    modules = procs[0].Modules;
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.FileName);
    }
    }

    C
    ArrayList ar = new ArrayList();
    Process[] procs;
    ProcessModuleCollection modules;
    procs =
    Process.GetProcesses(@"C:\TestApps\Process1.exe");
    if (procs.Length > 0) {
    modules = procs[0].Modules
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.ModuleName);
    }
    }

    D
    ArrayList ar = new ArrayList();
    Process[] procs;
    ProcessModuleCollection modules;
    procs = Process.GetProcessesByName(
    @"C:\TestApps\Process1.exe");
    if (procs.Length > 0) {
    modules = procs[0].Modules;
    foreach (ProcessModule mod in modules) {
    ar.Add(mod.FileName);
    }
    }

    Note: Not available
    1. Report
  6. Question: You need to write a code segment that will create a common language runtime (CLR) unit of isolation within an application. Which code segment should you use?

    A
    System.ComponentModel.Component myComponent;
    myComponent = new System.ComponentModel.Component();

    B
    AppDomainSetup mySetup =
    AppDomain.CurrentDomain.SetupInformation;
    mySetup.ShadowCopyFiles = "true";

    C
    System.Diagnostics.Process myProcess;
    myProcess = new System.Diagnostics.Process();

    D
    AppDomain domain;
    domain = AppDomain.CreateDomain("MyDomain");

    Note: Not available
    1. Report
  7. Question: You use Reflection to obtain information about a method named MyMethod. You need to ascertain whether MyMethod is accessible to a derived class. What should you do?

    A
    Call the IsStatic property of the MethodInfo class.

    B
    Call the IsVirtual property of the MethodInfo class.

    C
    Call the IsFamily property of the MethodInfo class.

    D
    Call the IsAssembly property of the MethodInfo class.

    Note: Not available
    1. Report
  8. Question: You are writing a method that accepts a string parameter named message. Your method must break the message parameter into individual lines of text and pass each line to a second method named Process. Which code segment should you use?

    A
    StringReader reader = new StringReader(message);
    while (reader.Peek() != -1) {
    Process(reader.ReadLine());
    }
    reader.Close();

    B
    StringReader reader = new StringReader(message);
    while (reader.Peek() != -1) {
    string line = reader.Read().ToString();
    Process(line);
    }
    reader.Close();

    C
    StringReader reader = new StringReader(message);
    Process(reader.ReadToEnd());
    reader.Close();

    D
    StringReader reader = new StringReader(message);
    Process(reader.ToString());
    reader.Close();

    Note: Not available
    1. Report
  9. Question: 

    You create a class library that is used by applications in three departments of your company. The library contains a Department class with the following definition.

    public class Department {

    public string name;

    public string manager;

    }

    Each application uses a custom configuration section to store department-specific values in the application configuration file as shown in the following code.

    <Department>

    <name>Hardware</name>

    <manager>Amy</manager>

    </Department>

    You need to write a code segment that creates a Department object instance by using the field values retrieved from the application configuration file.

    Which code segment should you use?

    A
    public class deptElement: ConfigurationElement {
    protected override void DeserializeElement(
    XmlReader reader, bool serializeCollectionKey) {
    Department dept = new Department();
    dept.name = reader.GetAttribute("name");
    dept.manager = reader.GetAttribute("manager");
    }
    }

    B
    public class deptHandler : IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) {
    Department dept = new Department();
    dept.name = section.Attributes["name"].Value;
    dept.manager = section.Attributes["manager"].Value;
    return dept;
    }
    }

    C
    public class deptElement : ConfigurationElement {
    protected override void DeserializeElement(
    XmlReader reader, bool serializeCollectionKey) {
    Department dept = new Department(); dept.name = ConfigurationManager.AppSettings["name"]; dept.manager = ConfigurationManager.AppSettings["manager"];
    return dept;
    }
    }

    D
    public class deptHandler : IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) {
    Department dept = new Department();
    dept.name = section.SelectSingleNode("name").InnerText; dept.manager =
    section.SelectSingleNode("manager").InnerText;
    return dept;
    }
    }

    Note: Not available
    1. Report
  10. Question: 

    You create an application to send a message by e-mail. An SMTP server is available on the local subnet. The SMTP server is named smtp.contoso.com.

    To test the application, you use a source address, me@contoso.com, and a target address, you@contoso. com.

    You need to transmit the e-mail message.

    Which code segment should you use?

    A
    MailAddress addrFrom =
    new MailAddress("me@contoso.com", "Me");
    MailAddress addrTo =
    new MailAddress("you@contoso.com", "You");
    MailMessage message = new MailMessage(addrFrom, addrTo); message.Subject = "Greetings!"; message.Body = "Test";
    SocketInformation info = new SocketInformation();
    Socket client = new Socket(info);
    System.Text.ASCIIEncoding enc =
    new System.Text.ASCIIEncoding();
    byte[] msgBytes = enc.GetBytes(message.ToString());
    client.Send(msgBytes);

    B
    MailAddress addrFrom = new MailAddress("me@contoso.com"); MailAddress addrTo = new MailAddress("you@contoso.com"); MailMessage message = new MailMessage(addrFrom, addrTo); message.Subject = "Greetings!";
    message.Body = "Test";
    SmtpClient client = new SmtpClient("smtp.contoso.com"); client.Send(message);

    C
    string strSmtpClient = "smtp.contoso.com";
    string strFrom = "me@contoso.com";
    string strTo = "you@contoso.com";
    string strSubject = "Greetings!";
    string strBody = "Test";
    MailMessage msg =
    new MailMessage(strFrom, strTo, strSubject, strSmtpClient);

    D
    MailAddress addrFrom =
    new MailAddress("me@contoso.com", "Me");
    MailAddress addrTo =
    new MailAddress("you@contoso.com", "You");
    MailMessage message = new MailMessage(addrFrom, addrTo); message.Subject = "Greetings!";
    message.Body = "Test";
    message.Dispose();

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