Skip to main content

Networking In C Sharp — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Networking In C Sharp — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
38
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
46 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
38

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/38 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 38
★ FPSC ★ PPSC

What is the purpose of the System.Net.WebSockets.ClientWebSocket class in C#?

Question 2 of 38
★ FPSC ★ PPSC

Which method is used to close a network stream in C#?

Question 3 of 38
★ FPSC ★ PPSC

What is the purpose of the System.Net.WebSockets.WebSocketServer class in C#?

Question 4 of 38
★ FPSC ★ PPSC

Which class in C# is used for representing a URI (Uniform Resource Identifier)?

Question 5 of 38
★ FPSC ★ PPSC

Which of these is a standard for communicating multimedia content over email?

Question 6 of 38
★ FPSC ★ PPSC

Select the properties related to the network errors generated by WebException:

Question 7 of 38
★ FPSC ★ PPSC

Which of these data members of HttpResponse class is used to store the response from a http server?

Question 8 of 38
★ FPSC ★ PPSC

Which of the following are the interfaces defined by the namespace System.Net?

Question 9 of 38
★ FPSC ★ PPSC

Which of the following are the protocols defined by .NET runtime?

Question 10 of 38
★ FPSC ★ PPSC

Which of these classes is used for operating on the request from the client to the server?

Question 11 of 38
★ FPSC ★ PPSC

Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.

Question 12 of 38
★ FPSC ★ PPSC

What does the following method specify? public static WebRequest Create(string requestUriString)

Question 13 of 38
★ FPSC ★ PPSC

Which of the following is the full form of DNS?

Question 14 of 38
★ FPSC ★ PPSC

Which of the following class/classes supports the task of uploading and downloading the file?

Question 15 of 38
★ FPSC ★ PPSC

Which of the following are the classes that support the standard HTTP protocol?

Question 16 of 38
★ FPSC ★ PPSC

Which of these methods gives the full URL of an URL object?

Question 17 of 38
★ FPSC ★ PPSC

What does the following C# code block define? class Gen<T> { T ob; }

Question 18 of 38
★ FPSC ★ PPSC

Which of these is an correct way of defining generic method?

Question 19 of 38
★ FPSC ★ PPSC

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(); } }

Question 20 of 38
★ FPSC ★ PPSC

Why are generics used?

Question 21 of 38
★ FPSC ★ PPSC

What exception is thrown if the user does not have a proper authorization?

Question 22 of 38
★ FPSC ★ PPSC

Select the type argument of open constructed type?

Question 23 of 38
★ FPSC ★ PPSC

What does the following form define? Protocol://HostName/FilePath?Query

Question 24 of 38
★ FPSC ★ PPSC

Choose the exceptions generated by the GetReponse() method defined by WebRequest.

Question 25 of 38
★ FPSC ★ PPSC

What will be the output of the following C# code? class Program { static void Main(string[] args) { Uri obj = new Uri("https://www.example.com"); Console.WriteLine(obj.AbsoluteUri); Console.ReadLine(); } }

Question 26 of 38
★ FPSC ★ PPSC

Which of these exceptions is thrown by the URL class's constructors?

Question 27 of 38
★ FPSC ★ PPSC

Choose the exceptions generated by the Create() method defined by WebRequest.

Question 28 of 38
★ FPSC ★ PPSC

Which of these classes is used to create servers that listen to either local or remote client programs?

Question 29 of 38
★ FPSC ★ PPSC

Which of the following classes is used to encapsulate IP address and DNS?

Question 30 of 38
★ FPSC ★ PPSC

Which of these classes is used to encapsulate IP address and DNS?

Question 31 of 38
★ FPSC ★ PPSC

What exception is thrown if the protocol supported by URI prefix is invalid?

Question 32 of 38
★ FPSC ★ PPSC

What exception is thrown if the URI format is invalid?

Question 33 of 38
★ FPSC ★ PPSC

Which namespace is mostly preferred for the operation of networking in C#?

Question 34 of 38
★ FPSC ★ PPSC

How many bits are present in a single IP address?

Question 35 of 38
★ FPSC ★ PPSC

What does URL stand for?

Question 36 of 38
★ FPSC ★ PPSC

Which of these classes is used to access actual bits or content information of a URL?

Question 37 of 38
★ FPSC ★ PPSC

Which of the following are the classes defined by the namespace System.Net?

Question 38 of 38
★ FPSC ★ PPSC

How many ports of TCP/IP are reserved for specific protocols?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →