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.
I prefer to hit count all of my pages separately and since I'm a lazy programmer, I decided to let Google Analytics track the hits for me. That's a free service and all you have to do is to drop some JavaScript into your pages. You can set up a free account and visit them to get neat graphs that show a lot of good information about your users.
http://www.google.com/analytics/
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:
http://awstats.sourceforge.net/
If you have a shared hosting site, then that specific provider will offer this kind of log graphing functionality and it's normally free.
Eric