Question:Certkiller .com has asked you to create a file management application to monitor the hosts file.
Certkiller .com has instructed you to change the hosts file if it has been changed.
You, therefore, need to display the size and whether the hosts file is set to read-only.
What should you do? - (VB.NET)
A Use the following code:
Dim hosts As New FileInfo("C:\Windows\system32\drivers\etc\hosts")
Console.WriteLine("ReadOnly?" + hosts.IsReadOnly)
Console.WriteLine("Size?" + hosts.Length)
B Use the following code:
Dim hosts As New File("C:\Windows\system32\drivers\etc\hosts")
Console.WriteLine("ReadOnly?" + hosts.IsReadOnly)
Console.WriteLine("Size?" + hosts.Length)
C Use the following code:
Dim hosts As New File("C:\Windows\system32\drivers\etc\hosts")
Console.WriteLine("ReadOnly?" + hosts.GetReadOnly)
Console.WriteLine("Size?" + hosts.GetLength)
D Use the following code:
Dim hosts As New FileInfo("C:\Windows\system32\drivers\etc\hosts")
Console.WriteLine("ReadOnly?" + hosts.IsReadOnly)
Console.WriteLine("Size?" + hosts.Size)