200. Current state of a windows service can be known programmatically. [0.5]
a) True b) False
201. The .Net SDK provides the ______________ class to determine the state of any windows service. [0.5]
a) ServeControl b) ServiceController
202. The _________ method retrieves all the services registered on the local system. [0.5]
a) ObtainServices() b) GetServices()
203. The display name of a windows service is fetched using the _________property. [0.5]
a) DisplayName b) Name
204. The current status of the windows service is obtained using the _______ property. [0.5]
a) GetStatus b) Status
205. The Status property holds an enumerator of the enumeration ServiceControllerStatus. [0.5]
a) True b) False
206. Windows services have user interfaces. [0.5]
a) True b) False
131 trang |
Chia sẻ: maiphuongdc | Lượt xem: 2483 | Lượt tải: 2
Bạn đang xem trước 20 trang tài liệu Ngân hàng câu hỏi trắc nghiệm IT, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
se
d)
Statement 2 is false
213.
Which of the following is/are true regarding the ServiceController class?
[1.0]
a)
The GetServices() method of the ServiceController class is a static method.
c)
The GetServices() method of the ServiceController class is not a static method.
b)
The GetServices() method retrieves all the services registered on the local system.
d)
The GetServices() method retrieves all the services running on the local system.
214.
Statement 1: The GetServices() method returns only one object of the class ServiceController for all services registered on the system.
Statement 2: The GetServices() method returns an array of the ServiceController class where each array element refers to each of the services registered on the system.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
215.
The Status property of ServiceController class holds an enumerator of the ServiceControllerStatus enumeration that has ________ options.
[1.0]
a)
Five
c)
Three
b)
Two
d)
Seven
216.
Which of the following would best describe the Running enumerator of the ServiceControllerStatus enumeration?
[1.0]
a)
The Windows service is Running.
c)
The Windows service has been Paused.
b)
The Windows service is Not Running.
d)
None of the above.
217.
Which of the following would best describe the Stopped enumerator of the ServiceControllerStatus enumeration?
[1.0]
a)
The Windows service is Running.
c)
The Windows service has been Paused.
b)
The Windows service is Not Running.
d)
None of the above.
218.
Statement 1: The Source property can contain the text that appears in the source category of the Application log.
Statement 2: The Log property can contain the text that appears in the source category of the Application log.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
219.
Statement 1: The EventLog class resides in the namespace System.Diagnostics.
Statement 2: The Log property is used to get or set the Windows event log to which the windows service writes.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
220.
Which of the following would describe the Paused enumeration member of the ServiceControllerStatus enumeration?
[1.0]
a)
The Windows service is Running.
c)
The Windows service has been Paused.
b)
The Windows service is Not Running.
d)
None of the above.
221.
Statement 1: The EventLog class of the System.Diagnostics namespace provides interaction with the Windows event logs.
Statement 2: The Log property is used to get or set the name of the windows event log to read or write.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
222.
Statement 1: Setting Log property of an object of the EventLog class to Application allows windows service to write to the Application event log.
Statement 2: Setting Log property of an object of the EventLog class to ApplicationEvent allows windows service to write to the Application event log.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
223.
Which of the following is/are true regarding the WriteEntry() method of EventLog class?
[1.0]
a)
It is an overloaded method.
c)
It writes the string as the Log entry.
b)
It takes in one string parameter only.
d)
It returns void.
224.
Which of the following statements is/are true regarding the ServiceController class methods?
Statement 1: By calling the Pause() method, a windows service can be made to temporarily stop execution.
Statement 2: By calling the Continue() method, a paused windows service can be made to resume execution.
[1.5]
a)
Statement 1 is true.
c)
Statement 2 is true.
b)
Statement 1 is false.
d)
Statement 2 is false.
225.
Which of the following is/are true?
[1.5]
a)
To report any errors, windows services utilize the event logging architecture of Windows although they do not lack a user interface.
d)
Windows 2000 maintains three different types of logs- the Application log, the Security log and the SystemEvent log.
b)
A windows service can be made to write an error message to a log file when it encounters a problem.
e)
Windows services can write to any of the event logs viewed from the Event viewer.
c)
By default, all windows services write to the system log every time they start and stop.
226.
Which of the following code snippets will enable the windows service to write a custom log event to the Application log of Windows along with logging the filename?
[1.5]
a)
...
EventLog evt = new EventLog();
evt.Log = "App";
evt.Source="Windows Service";
evt.WriteEntry(”Operation Complete!”);
...
c)
...
EventLog evt = new EventLog();
evt.LogProperty = "Application";
evt.Source="Windows Service";
evt.WriteEntry(”Operation Complete!”);
...
b)
...
EventLog evt = new EventLog();
evt.Log = "Application";
evt.Source="Windows Service";
evt.WriteEntry(”Operation Complete!”);
...
d)
...
EventLog evt = new EventLog();
evt.Log = "Application";
evt.Source="Windows Service";
evt.Write(”Operation Complete!”);
...
227.
Which of the following would best describe the StartPending enumerator of the ServiceControllerStatus enumeration?
[1.5]
a)
The Windows service is Running.
d)
The Windows service is Stopping.
b)
The Windows service is Starting.
e)
The Windows service is starting after a pause.
c)
The Windows service is Pausing.
228.
Which of the following would best describe the ContinuePending enumerator of the ServiceControllerStatus enumeration?
[1.5]
a)
The Windows service is Running.
d)
The Windows service is Stopping.
b)
The Windows service is Starting.
e)
The Windows service is starting after a pause.
c)
The Windows service is Pausing.
229.
Which of the following would best describe the StopPending enumerator of the ServiceControllerStatus enumeration?
[1.5]
a)
The Windows service is Not Running.
d)
The Windows service is Stopping.
b)
The Windows service has been Paused.
e)
The Windows service is starting after a pause.
c)
The Windows service is Pausing.
230.
Which of the following would best describe the PausePending enumerator of the ServiceControllerStatus enumeration?
[1.5]
a)
The Windows service is Not Running
d)
The Windows service is Stopping
b)
The Windows service has been Paused
e)
The Windows service is starting after a pause
c)
The Windows service is Pausing
231.
Which of the following statements is/are true regarding the ServiceController class methods?
Statement 1: By calling the method Stop(), the windows service is stopped but the program does not exit.
Statement 2: By calling the method Start(),the windows service starts if it is not running initially.
[1.5]
a)
Statement 1 is true.
c)
Statement 2 is true.
b)
Statement 1 is false.
d)
Statement 2 is false
232.
Consider the snippet given below:
...
ServiceController[] sers =
ServiceController.GetServices();
foreach(ServiceController s in sers)
{
Console.WriteLine("\nService Name :
{0}",s.DisplayName);
Console.WriteLine("ServiceStatus :
{0}",s.Status);
}
Which of the following is/are true?
[1.5]
a)
The code above will generate an error.
d)
The status of each service in sers object is displayed on the console..
b)
The array object sers contains all the services registered on the local system.
e)
The array object sers contains all the services registered on the remote system.
c)
The display name for each service in sers object is displayed on the console.
233.
Consider a windows service named “FirstWinService”. Its status is to be checked to see if it is running; if it is then it displays the message “The service FirstWinService is running” else it starts the service.
Which of the following is/are true?
[1.5]
a)
if(s.DisplayName==
“FirstWinService”) {
Console.WriteLine("The service {0} is running",s.DisplayName);
}else{
s.Start();
}
c)
if(s.DisplayName==
“FirstWinService”){
if(s.Status ==
System.ServiceProcess.
ServiceControllerStatus.
Running){
Console.WriteLine("The service {0} is
running",s.DisplayName);
}
}
b)
if(s.DisplayName==
“FirstWinService”){
if(s.Status ==
System.ServiceProcess.
ServiceControllerStatus.
Stopped) {
Console.WriteLine("The service {0} is
running",s.DisplayName);
}
else{
s.Start();
}
}
d)
if(s.DisplayName==
“FirstWinService”)
{
if(s.Status ==
System.ServiceProcess.
ServiceControllerStatus.
Running)
{
Console.WriteLine("The service {0} is
running",s.DisplayName);
}
Else
{
s.Start();
}
}
234.
Which of the following is/are the method(s) used for event logging process?
[2.0]
a)
WriteEvents()
c)
WriteEvent()
b)
WriteEntries()
d)
WriteEntry()
235.
Which of the following is/are the method(s) of ServiceController class?
[2.0]
a)
Start()
d)
ExecuteStatement()
b)
Continue()
e)
Pause()
c)
Stopping()
236.
Which of the following is/are the class(es) used for event logging in the System.Diagnostics namespace?
[2.0]
a)
EventLog
d)
EventLogInstall
b)
EventLogEntry
e)
EventLogTraceListener
c)
EventLogEntriesCollected
237.
Which of the following is/are true regarding the properties of the ServiceController class?
[2.0]
a)
The property DependentServices returns a collection of dependent services.
c)
The property ServiceType indicates whether only one or more than one service can run within the same process.
b)
The property ServicesDependentOn returns a collection of the services that the service depends on.
d)
All of the above.
238.
Statement 1: GetServices() method can only be invoked by instantiating an object for the class ServiceController to return an array of ServiceController class objects that represent all windows services.
Statement 2: GetServices() is a static method of the ServiceController class and it returns a ServiceController array representing all windows services registered on the local system.
[2.5]
a)
Statement 1 is true.
c)
Statement 2 is true.
b)
Statement 1 is false.
d)
Statement 2 is false.
239.
Statement 1: The ServiceController class has a static method GetDevices() that returns a ServiceController array representing all device driver services on a computer.
Statement 2: The ServiceController class has a static method GetDrivers() that returns a ServiceController array representing all device driver services on a computer.
[2.5]
a)
Statement 1 is true.
c)
Statement 2 is true.
b)
Statement 1 is false.
d)
Statement 2 is false.
240.
Which of the following is/are true?
[2.5]
a)
A service class derived from ServiceBase automatically logs Start & Stop events when the AutoLog property is set to true.
c)
A service class derived from ServiceBase logs events irrespective of the AutoLog property being true or false.
b)
The ServiceBase class checks the AutoLog property and writes a log entry at start, stop, pause and continue requests.
d)
The ServiceBase class checks the AutoLog property and writes log entries only at start and stop requests.
241.
Which of the following is/are true regarding the event log files?
[2.5]
a)
Applications and services write to application log files.
d)
Security Log file is used by the operating system for auditing purpose.
b)
System Log file is used for the system and device drivers.
e)
All of the above.
c)
Security Log file is read only for applications.
242.
The XmlWriter class is an abstract class required to write XML data to streams.
0.5
a)
True
b)
False
243.
The _________ class gives a tree representation of an XML document, which enables its navigation and editing.
[0.5]
a)
XmlTemplate
b)
XmlDocument
244.
The XmlTextReader is derived from the class _____________.
[0.5]
a)
XmlReader
b)
XmlReadCharStream
245.
The _______ value for ValidationType property is to validate the document according to DTD rules.
[0.5]
a)
XDR
b)
DTD
246.
The WriteStartDocument() method writes the XML declaration with the version "1.0".
[0.5]
a)
True
b)
False
247.
The stream created by XmlWriter can be closed using the Close() method of the object.
[0.5]
a)
True
b)
False
248.
The method _________ of the XmlTextWriter class is used to write the string data within an element to the XML file.
[0.5]
a)
WriteString()
b)
WriteStartElement()
249.
ADO.NET uses _______ to transport data from the data store to the web pages.
[0.5]
a)
HTML
b)
XML
250.
The contents of the dataset are written to an XML file using the _________ method of the dataset object.
[0.5]
a)
WriteXml()
b)
Write()
251.
The XmlValidatingReader class implements the _________ class.
[0.5]
a)
XmlCharReader
b)
XmlReader
252.
The class XmlNodeList does not represent an ordered collection of nodes within the XML document.
[0.5]
a)
True
b)
False
253.
Which of the following are the classes of the System.Xml namespace?
[1.0]
a)
XmlReader
c)
XmlCharReader
b)
XmlWriter
d)
XmlCharWriter
254.
XML written using the XmlTextWriter class conforms to the W3C Extensible Markup Language 1.0 specification but not to the Namespaces in XML specification.
[1.0]
a)
True
b)
False
255.
Statement 1: The Flush() method flushes the buffer and writes whatever data is left in the buffer to the stream.
Statement 2: The Flush() method flushes the buffer but does not write data left in the buffer to the stream.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
256.
Statement 1: The XmlValidatingReader class cannot take the class XmlTextReader as an input.
Statement 2: Being an implementation of the XmlReader class, the XmlValidatingReader class can take the class XmlTextReader as an input.
[1.0]
a)
Statement 1 is true
c)
Statement 2 is true
b)
Statement 1 is false
d)
Statement 2 is false
257.
Which of the following statements are true for DTDs and Schemas?
[1.0]
a)
DTDs can be used to define document structure, data types, and content constraints.
c)
Schemas can be used to define document structure, data types, and content constraints.
b)
Schemas cannot be used to define document structure, data types, and content constraints.
d)
DTDs cannot be used to define document structure, data types, and content constraints.
258.
The GetElementsByTagName() method of the XmlDocument class returns the ________ object containing a list of all descendant elements that match the specified name.
[1.0]
a)
XmlNodeAllList
c)
XmlNodeListElement
b)
XmlNodeListAll
d)
XmlNodeList
259.
Which of the following method exists in the XmlDocument class to return list of all descendant elements?
[1.0]
a)
GetElementsTagName()
c)
GetElementsByTagName()
b)
GetElementsbyname()
d)
GetElementsByTag()
260.
The ___________ method of the XmlDocument class is used to create a new element in the XML file.
[1.0]
a)
CreateNewElement()
c)
CreateElements()
b)
Create()
d)
CreateElement()
261.
Which of the following properties does the class XmlValidatingReader include?
[1.0]
a)
ValidationType
c)
Schema Type
b)
Schemas
d)
All of the above
262.
Which of the following statements are true?
[1.0]
a)
When the XML document needs to be indented, Formatting.Indented enumeration is specified.
c)
When the XML document needs to be indented, Formatting.Indent enumeration is specified.
b)
When the XML document does not require being indented, Formatting.No enumeration is specified.
d)
When the XML document does not require being indented, Formatting.None enumeration is specified.
263.
Which of the following are valid values for the ValidationType property?
[1.0]
a)
DTD
d)
Auto
b)
Schema
e)
All of the above
c)
XRD
264.
Consider the snippet given below:
string fname = "d:\\employee.xml";
XmlTextWriter writer = new XmlTextWriter (fname, null);
writer.Formatting = Formatting.Indented;
writer.Indentation= 4;
Which of the following is true?
[1.5]
a)
An XML file called employee.xml in the root directory of drive d is created if it does not exist.
d)
The number of spaces to be indented in the file employee.xml is set to four.
b)
The Formatting property of the writer object is used to specify the format for the XML document.
e)
All of the above
c)
The file employee.xml is indented as the Formatting.Indented enumeration is specified. The file employee.xml is indented as the Formatting.Indented enumeration is specified.
265.
Consider the following snippet below:
XmlTextWriter writer = new XmlTextWriter(“d:\\emp.xml”, null);
Which of the following statements are true?
[1.5]
a)
The writer object can be used to write data to the XML file emp.xml in d: drive.
c)
There is only one type of XmlTextWriter constructor.
b)
The file emp.xml associated with the writer object does not have any encoding style.
d)
All of the above
266.
Consider an element Employee to be created. Within the element Employee there are two more elements, Name and Salary. The value of the Name and Salary elements should be Martin and 50000 respectively.
Which of the following will be used to create a structure such as the one mentioned above?
[1.5]
a)
Writer.WriteStartElement("", "Employee", "");
Writer.WriteStartElement("", "Name", "");
Writer.WriteString("Martin");
Writer.WriteEndElement();
Writer.WriteStartElement("", "Salary", "");
Writer.WriteString("50000");
Writer.WriteEndElement();
c)
Writer.WriteStartElement("", "Employee", "");
Writer.WriteStartElement("", "Name", "");
Writer.WriteStartElement("", "Salary", "");
Writer.WriteString("Martin");
Writer.WriteString("50000");
b)
Writer.WriteStartElement("", "Employee", "");
Writer.WriteStartElement("", "Name", "");
Writer.WriteString("Martin");
Writer.WriteStartElement("", "Salary", "");
Writer.WriteString("50000");
Writer.WriteEndElement();
d)
Writer.WriteStartElement("", "Employee", "");
Writer.WriteStartElement("", "Name", "");
Writer.WriteString("Martin");
Writer.WriteEndElement();
Writer.WriteStartElement("", "Salary", "");
Writer.WriteString("50000");
Writer.WriteEndElement();
Writer.WriteEndElement();
267.
Which of the following statements are true regarding the XmlReader class?
[1.5]
a)
provides fast access to streams of XML data, but access is limited to a backward-only, read-only cursor.
d)
It is an abstract class and the XmlTextReader class inherits from it.
b)
Using it, programs that switch back and forth within an XML file cannot be written but can only be read in a forward direction.
e)
All of the above.
c)
It provides a less resource-demanding way to read XML files.
268.
Which of the following statements are true?
[1.5]
a)
To check if the node read is an element node, the NodeType property of the Reader object and the XmlNodeType enumeration are used.
c)
To check if the node read is an element node, the type of the node is compared with the enumerator XmlNodeType.IsElement of the XmlNodeType enumeration.
b)
The NodeType property gets the type of the current node.
d)
To check if the node read is an element node, the type of the node is compared with the enumerator XmlNodeType.Element of the XmlNodeType enumeration.
269.
The xml file, doctor.xml, has an element called Name. Which of the following will be used to display the data enclosed within the Name element on the console?
[1.5]
a)
XmlTextReader rd = new XmlTextReader
(“d:\\doctor.xml");
while (rd.Read()){
if (rd.NodeType == XmlNodeType.Element){
if (rd.LocalName.
Equals("Name")){
Console.Write("The doctors name is {0} ”,
rd.ReadString());
}
}
}
c)
XmlTextReader rd = new XmlTextReader (“d:\\doctor.xml");
while (rd.Read()){
if (rd.NodeType == XmlNodeType.Elements){
if (rd.LocalName.Equals("Name")){
Console.Write("The doctors name is {0} ”,
rd.ReadString());
}
}
}
b)
XmlTextReader rd = new XmlTextReader
(“d:\\doctor.xml");
while (rd.Read()){
if (rd.Node == XmlNodeType.Elements){
if (rd.Name.Equals("Name")){
Console.Write("The doctors name is {0} ”,
rd.Read());
}
}
}
d)
XmlTextReader rd = new XmlTextReader (“d:\\doctor.xml");
while (rd.Read()){
if (rd.NodeType == XmlNodeType.Element){
if (rd.Name.Equals("Name")){
Console.Write("The doctors name is {0} ”,
rd.ReadString());
}
}
}
270.
Which of the following statements is/are true?
[1.5]
a)
The Document Object Model is used to avoid going through an entire XML document for just a little piece of code.
c)
In DOM a particular node is selected by using the GetElementsByTagName() method of the XmlDocument class.
b)
Using the DOM a particular node can be selected.
d)
All of the above.
271.
What happens when the ValidationType property is set to Auto?
[1.5]
a)
The document is validated according to DTD rules.
d)
No Validation is required.
b)
The document is validated according to the XSD schema.
e)
It detects the type of validation based on the declarations found within the document.
c)
The document is validated according to XDR Schema.
272.
What happens when the ValidationType property is set to XDR?
[1.5]
a)
The document is validated according to DTD rules.
c)
No Validation is required.
b)
The document is validated according to the XSD schema.
d)
It detects the type of validation based on the declarations found within the document.
c)
The document is validated according to XDR Schema.
273.
What happens when the ValidationType property is set to Schema?
[1.5]
a)
The document is validated according to DTD rules.
d)
No Validation is required.
b)
The document is validated according to the XSD schema.
e)
It detects the type of validation based on the declarations found within the document.
c)
The document is validated according to XDR Schema.
274.
Which of the following statements is/are true?
[2.0]
a)
The class XmlLinkedNode provides a means to return only the node immediately before the current node.
c)
The class XmlLinkedNode provides a means to return the node immediately before or after the current node.
b)
The class XmlLinkedNode provides a means to only return the node immediately after the current node.
d)
All of the above.
275.
Which of the following statements is/are true regarding the Document Object Model implementation in .NET?
[2.0]
a)
It supports the W3C DOM Level 1 specification only.
c)
It supports the W3C DOM Level 1 and Core DOM Level 2 specification only.
b)
It supports the W3C DOM Level 2 specification only.
d)
It supports the W3C DOM Level 3 specification only.
276.
Which of the following statements are true?
[2.0]
a)
An XmlNode is an abstract class that represents multiple nodes in an XML document.
c)
An XmlNode is an abstract class that represents a single node in an XML document.
b)
The class XmlNode implements the class XmlDocument.
d)
The class XmlDocument implements the class XmlNode.
277.
Which of the following statements is true?
[2.0]
a)
The class XmlNodeReader uses an XmlNode as its source instead of a stream.
c)
All of the above.
b)
The class XmlTextReader can work with either—a stream-based object or a TextReader-based object.
278.
Which of the following statements are true?
[2.0]
a)
An XmlReader is an abstract class that provides fast and un-cached XML data.
c)
An XmlReader can read XML data in a backward direction.
b)
An XmlReader is a forward only reader.
d)
All of the above
279.
Which of the following statements is true?
[2.0]
a)
The class XmlDataDocument allows mixing of XML and relational data in the same view.
c)
All of the above.
b)
The class XmlURLResolver resolves external XML- based resources such as DTD and schema references by the URI.
280.
Which of the following classes is derived from the XmlReader class?
[2.0]
a)
XmlTextReader
c)
XmlValidatingReader
b)
XmlNodeReader
d)
All of the above
281.
Which of the following statements are true?
[2.0]
a)
The Schemas property of XmlValidatingReader holds an XmlSchemaCollection object.
c)
The XmlSchemaCollection object holds the preloaded XSD and XDR schema.
b)
The Auto property of XmlValidatingReader holds an XmlSchemaCollection object
d)
282.
Consider the snippet given below:
……
string filename=“..\\..\\names.xml”;
XmlTextReader tr = new XmlTextReader(filename);
……
Which of the following is true regarding the above code?
[2.5]
a)
The XmlTextReader object is initialized but no node is selected.
d)
A second call to tr.Read() will move to the next node in the document.
b)
The XmlTextReader object is initialized and XML Declaration node is selected.
e)
All of the above.
c)
When the method Read() is called on the object tr for