What should you do?
you have recently written the code shown below:
Hashtable emailAddresses = new Hashtable ();
emailAddresses.Add (“Mia”, “mia@ Domain.com”);
emailAddresses.Add (“Andy”, “andy@ Domain.com”);
emailAddresses.Add (“Kara”, “kara@ Domain.com”);
You need to ensure that these e-mail addresses are stored in the Email.dat file so that you can load them again
when the user restarts the application.
What should you do?
What should you do?
You have recently written the code shown below:
Hashtable emailAddresses = new Hashtable ();
emailAddresses.Add (“Mia”, “mia@ Domain.com”);
emailAddresses.Add (“Andy”, “andy@ Domain.com”);
emailAddresses.Add (“Kara”, “kara@ Domain.com”);
FileStream stream = new FileStream (“Email.dat”, FileMode.Create);
BinaryFormatter formatter = new BinaryFormatter ();
formatter.Serialize (stream, emailAddresses);
You need to ensure that you are able to load the emailAddresses object from the Email.dat file into your application.
What should you do?
What should you do?
You have recently created a serializable class named Vehicle.
The class is shown below:
[Serializable]
public class Vehicle {
public string VIN;
public string Make;
private string Model;
private int Year;
private string Owner;
}
Domain.com does not want the Owner field to be persisted when a Vehicle object is serialized, for security reasons.
You need to ensure that this objective is fulfilled.
What should you do?
What should you do?
You develop a serializable class for persisting objects as files.
Every time an object is serialized, you have to update the database with the name of the object and location of that file.
You elect to employ the OnSerialized attribute to achieve this objective.
You now need to apply the OnSerialized attribute to a certain method.
What should you do?
What should you do?
You have recently created a serializable class named Vehicle.
The class is shown below:
[Serializable]
public class Vehicle{
public string VIN;
public string Make;
public string Model;
public string Year;
}
You are planning to create a custom formatter class to control the formatting of Vehicle objects when they are serialized.
You need to ensure that is achieved with as little development effort as possible.
What should you do?
What should you do?
Domain.com has given you the task of serializing an object and writing it to a data file using binary serialization.
You need to ensure that you meet these requirements.
What should you do?
Which attribute should you place on the method?
You are developing an application that uses role-based security. The prinicipal policy of the application domain is configured during startup with the following code:
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
You need to restrict access to one of the methods in your application so that only members of the local Administrators group can call the method.
Which attribute should you place on the method?
Which code segment should you use?
You need to write a code segment that will add a string named strConn to the connection string
section of the application configuration file. Which code segment should you use?
Which event would you use to run a method immediately after serialization occurs?
Which event would you use to run a method immediately after serialization occurs?
Where can you add to a LinkedList?
Where can you add to a LinkedList? (Choose all that apply)