This section of our 1000+ C# MCQs focuses on networking errors in C# Programming Language.
1. What exception is thrown if the URI format is invalid?
a) URLNotFound
b) URLSourceNotFound
c) MalformedURLException
d) UriFormatException
2. What exception is thrown if the protocol supported by URI prefix is invalid?
a) URLNotFound
b) URLSourceNotFound
c) UriFormatException
d) NotSupportedException
3. What exception is thrown if the user does not have a proper authorization?
a) URLNotFound
b) URLSourceNotFound
c) System.Security.SecurityException
d) All of the mentioned
4. Choose the exceptions generated by the Create() method defined by WebRequest.
a) NotSupportedException
b) UriFormatException
c) System.Security.SecurityException
d) All of the mentioned
5. Choose the exceptions generated by the GetReponse() method defined by WebRequest.
a) InvalidOperationException
b) ProtocolViolationException
c) WebException
d) All of the mentioned
6. Select the properties related to the network errors generated by WebException:
a) response
b) get
c) set
d) none of the mentioned
public WebResponse Response { get; }
When an error occurs, we can use the Status property of WebException to find out what went wrong. It is defined like this:
public WebExceptionStatus Status {get; }
7. Which of these classes is used for operating on the request from the client to the server?
a) http
b) httpDecoder
c) httpConnection
d) httpd
8. Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.
a) ProtocolViolationException
b) ObjectDisposedException
c) IOException
d) All of the mentioned
9. Which of these classes is used to create servers that listen to either local or remote client programs?
a) httpServer
b) ServerSockets
c) MimeHeader
d) HttpResponse
10. Which of these methods gives the full URL of an URL object?
a) fullHost()
b) getHost()
c) AbsoluteUri
d) toExternalForm()