What is the purpose of the System.Net.WebSockets.ClientWebSocket class in C#?
A. To create a TCP client
B. To handle UDP communications
C. To provide WebSocket client functionality
D. To establish a connection to a TCP server
Select an option to see the answer and solution.
Which method is used to close a network stream in C#?
A. End()
B. Close()
C. Terminate()
D. None of the above
Select an option to see the answer and solution.
What is the purpose of the System.Net.WebSockets.WebSocketServer class in C#?
A. To create a UDP client
B. To handle UDP communications
C. To implement a WebSocket server
D. To establish a connection to a TCP server
Select an option to see the answer and solution.
Which class in C# is used for representing a URI (Uniform Resource Identifier)?
A. System.Net.HttpWebRequest
B. System.Net.Mail.SmtpClient
C. System.Net.Sockets.TcpClient
D. System.Uri
Select an option to see the answer and solution.
Which of these is a standard for communicating multimedia content over email?
A. http
B. https
C. Mime
D. httpd
Select an option to see the answer and solution.
Select the properties related to the network errors generated by WebException:
A. response
B. get
C. set
D. none of the mentioned
Select an option to see the answer and solution.
Which of these data members of HttpResponse class is used to store the response from a http server?
A. status
B. address
C. statusResponse
D. statusCode
Select an option to see the answer and solution.
Which of the following are the interfaces defined by the namespace System.Net?
A. IAuthenticationModule
B. HttpWebRequest
C. WebProxy
D. HttpResponseHeader
Select an option to see the answer and solution.
Which of the following are the protocols defined by .NET runtime?
A. HTTP
B. HTTPS
C. File
D. All of the mentioned
Select an option to see the answer and solution.
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
Select an option to see the answer and solution.
What will be the output of the following C# code snippet?
public class Generic<T>
{
Stack<T> stk = new Stack<T>();
public void push(T obj)
{
stk.Push(obj);
}
public T pop()
{
T obj = stk.Pop();
return obj;
}
}
class Program
{
static void Main(string[] args)
{
Generic<string> g = new Generic<string>();
g.push(30);
Console.WriteLine(g.pop());
Console.ReadLine();
}
}A. 0
B. 30
C. Runtime Error
D. Compile time Error
Select an option to see the answer and solution.
Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.
A. ProtocolViolationException
B. ObjectDisposedException
C. IOException
D. All of the mentioned
Select an option to see the answer and solution.
What does the following method specify?
public static WebRequest Create(string requestUriString)A. Creates a WebRequest object for the URI specified by the string passed by requestUriString
B. The object returned will implement the protocol specified by the prefix of the URI
C. The object will be an instance of the class that inherits WebRequest
D. All of the mentioned
Select an option to see the answer and solution.
Which of the following is the full form of DNS?
A. Data Network Service
B. Data Name Service
C. Domain Network Service
D. Domain Name Service
Select an option to see the answer and solution.
Which of the following class/classes supports the task of uploading and downloading the file?
A. WebRequest
B. WebResponse
C. WebClient
D. All of the mentioned
Select an option to see the answer and solution.
Which of the following are the classes that support the standard HTTP protocol?
A. HttpWebRequest
B. HttpResponseHeader
C. HttpRequestHeader
D. HttpStatusCode
Select an option to see the answer and solution.
Which of these methods gives the full URL of an URL object?
A. fullHost()
B. getHost()
C. AbsoluteUri
D. toExternalForm()
Select an option to see the answer and solution.
What does the following C# code block define?
class Gen<T> {
T ob;
}A. Generics class declaration
B. Declaration of variable
C. A simple class declaration
D. Both Generics class declaration & Declaration of variable
Select an option to see the answer and solution.
Which of these is an correct way of defining generic method?
A. name(T1, T2, ..., Tn) { /* ... */ }
B. public name { /* ... */ }
C. class name[T1, T2, ..., Tn] { /* ... */ }
D. name{T1, T2, ..., Tn} { /* ... */ }
Select an option to see the answer and solution.
What will be the output of the following C# code?
class Program
{
static void Main(string[] args)
{
int ch;
HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.example.com");
HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
Stream istrm = resp.GetResponseStream();
for (int i = 1 ; ;i++)
{
ch = istrm.ReadByte();
if (ch == -1)
break;
Console.Write((char)ch);
if ((i % 400) == 0)
{
Console.Write("\nPress Enter.");
Console.ReadLine();
}
}
resp.Close();
}
}A. html
B. text
C. html/text
D. text/html
Select an option to see the answer and solution.