The code posted above was written in VBScript for the global.asa file. In ASP.NET we typically don't use VBScript and we use global.asax instead. We can put C# code in that file, and we have similar events to those used above. We also have application state that could be used to track the number of online users, but of course, you'll lose that when the application resets.
To track the number of hits on a specific page you could either update a server-side file, as the code above did, or else you can keep the counter in the DB. Or you can let an outside service do it for you.
The only thing it can't track is file downloads. The IIS logs have all that info, and a whole lot more, and the free awstats program does a great job of making cool reports based on that log info:
If you have a shared hosting site, then that specific provider will offer this kind of log graphing functionality and it's normally free.