Introduction

If a computer is on a LAN and has a DNS server, the code below can be used to get its IP address from the web host. This code is very simple. Use the Dns class to connect to the DNS server on the Local Area Network. It then returns an IPHostEntry object as IPHost. IPHost contains properties including the IP Address... See image.

Derived from: http://www.codeproject.com/KB/IP/gtestdns.aspx

  • Read and understand the code.
    • What is a class in C# and what is the distinction between a class and an object?
    • What does this statement do: //Input web host name as string
    • What is a method?
    • Why is this required: using System.Net and what happens if it is missed out?
    • Why are semicolons ; required?
  • Type in the program, compile and run. Note you will have to resolve any errors/warnings.
    • Note the Errors
    • Note the Warnings
    • Explain each one clearly and why they occur?
    • Explain how they can be corrected?
    • Present your findings in order, using the following table format: See image.
  • Convert the console application into a Form-based application:
    • Sketch suitable GUI using appropriate controls and justify the reasons behind the design. Follow good GUI design principles as discussed in lectures regarding transparency, consistency and feedback.
    • Implement your design in Visual Studio using C#
    • Perform and record suitable testing both black box and white box explaining the differences. A suggested test table format covered in lectures is: See image.
  • Extend your program by adding a number of appropriate features. (30%/15%) Your new features must not be trivial and must involve some programming challenge, e.g. error handling, pinging a hostname, opening the web host in a browser etc. Marks will be awarded based on the amount and complexity of features added. Check with your tutor if in doubt. You must document your additional features clearly in comments at the top of your code. If your advanced features are overlooked they may not gain credit.
  • Compare manual and visual programming
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.