Question
C# programming. 1.) Start by creating a new Visual Studio solution for this assignment. Just like before, it should be a Console app. After you
C# programming.
1.) Start by creating a new Visual Studio solution for this assignment. Just like before, it should be a Console app. After you have created the solution directory, download that real-world log file and move it into the same directory that Visual Studio created the new "program.cs" file in.
2.) Now, create a program that reads the data from that file and displays it with pre-pended line numbers. (This is an example if incremental improvement - first just make sure you can read the file.)
3.) Once that is working, change the program so that it parses each line and extracts the IP address, HTTP status code (usually 200), and the requested URL path (ex. "/styles/com.stockcharts.workbench.sc/scui.js") from each line of the log file. Note: URL paths do NOT include question marks or any of the stuff after question mark. For now, have your program print out just those three fields to the console.
4.) Once that is working, change the program so that it stores summary information about those fields in three different dictionaries - one for the IP addresses, one for the status codes, and one for the URL paths. Keep a running total for each unique entry in each of those dictionaries. At the end of the program, print out the contents of each dictionary in a seperate section. For the "IP Address" and "URL Paths" dictionary, only print out paths that have 10 or more requests.
5.) Once that is working, change the end of the program so that you display each of the dictionary's contents in sorted order. For the status counters, sort by the status itself (lowest to highest). For the IP Address counters, sort by frequency of IP address (highest to lowest). For the URL Paths, sort by frequency of URL path (highest to lowest).
You cannot use any part of LINQ for this assignment.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started