tags:

views:

85

answers:

5

I want to make a program that hosts a webpage with computer uptime of the system it is running on but I don't want to do anything to the user's IIS. Is there anyway to do by making some system calls (to the ISAPI dlls etc) in c#?

+1  A: 

Just serve the page yourself - a simple web server is not hard to write and there are a lot of examples available on the net; from extremely simple to quite advanced. For example this one.

Daniel Brückner
+4  A: 

You want to create a web server?

Try System.Net.HttpListener

You can get the system's uptime in milliseconds using System.Environment.TickCount

robinjam
+3  A: 

Take a look at the HTTPListener class: http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx

Rodrick Chapman
+1  A: 

If an alternative to IIS you seek, give Cassinni a try.

Wayne Hartman
+1  A: 

As has already been answered, HTTPListener is a good start.

However, you're quickly going to discover issues with firewalls and available ports, so ultimately I think you'll find that doing something to the user's IIS is likely the path of least resistance, at least on systems where IIS is already running.

If IIS isn't an option then you will either need the app itself or an installer to configure Windows Firewall to allow incoming connections. They also may have other software and hardware Firewalls in place which need configured.

hemp