.NET webserver

chronodekar

Senior member
Nov 2, 2008
721
1
0
Is there any such thing?

When creating an application for .NET, the usual front-end we all use are the standard windows. I'm thinking of making a program, but to have a web-interface to it instead. I'm thinking VERY general purpose here.

I know it is possible to build a web server in C#, but we'll have to handle the HTML manually. Does there exist something that will let us code the HTML with something else? (such as PHP or Python ?)

What I ultimately want is something that will let anyone design a web-interface with PHP (or the like) but will be running on .NET (or MONO). The front-end would be manipulating the local system in the background.

Does something like this exist? Or am I building a castle in the clouds?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
What exactly do you mean by "a web server in C#" or "a .NET webserver" or "running on .NET"? What is it going to do or be that Apache & IIS don't already cover?

If you design a web application in PHP + mySQL, you're done. IIS or Apache passes requests to the PHP and it does stuff, it doesn't usually need to jump to C# code.

It might help to go into more detail of how your system would work for an imaginary real-world application like a photo site, or forum, or anything else concrete.
 

chronodekar

Senior member
Nov 2, 2008
721
1
0
To what I understand, Apache and IIS are installs on your system. (They run services that need the system to be rebooted to work) And you can't just turn them on/off easily. (like minesweeper)

But, if you have an independent executable, you can. That's something of what I'm looking for. A web-server that can be turned on/off easily and can be run as an independant executable, without a huge drain on system resources.


Let me make an imaginary example, suppose I develop some new hardware that connects to the USB port of a PC. Now, after I connect my USB-device, I run my application. (The app should NOT have a GUI, but behave similar to an IM program, sitting on the taskbar)

Via a browser, you can interact with my USB device. Now, after 30 mins or so, I turn off the program, unplug my USB and move to another system. I don't want any garbage left behind on the first PC.

Am I clearer now?
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: chronodekar
To what I understand, Apache and IIS are installs on your system. (They run services that need the system to be rebooted to work) And you can't just turn them on/off easily. (like minesweeper)

But, if you have an independent executable, you can. That's something of what I'm looking for. A web-server that can be turned on/off easily and can be run as an independant executable, without a huge drain on system resources.


Let me make an imaginary example, suppose I develop some new hardware that connects to the USB port of a PC. Now, after I connect my USB-device, I run my application. (The app should NOT have a GUI, but behave similar to an IM program, sitting on the taskbar)

Via a browser, you can interact with my USB device. Now, after 30 mins or so, I turn off the program, unplug my USB and move to another system. I don't want any garbage left behind on the first PC.

Am I clearer now?

Why would you want a web interface in that scenario? Web interfaces are generally a compromise in performance and functionality vs. thick clients, but they are so much simpler to deploy, update and generally manage for a large number of users that they are wildly popular.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
To what I understand, Apache and IIS are installs on your system. (They run services that need the system to be rebooted to work) And you can't just turn them on/off easily. (like minesweeper)

You can stop and start services on any OS just fine, no reboot required.

But, if you have an independent executable, you can. That's something of what I'm looking for. A web-server that can be turned on/off easily and can be run as an independant executable, without a huge drain on system resources.

Any webapp that installs a web server is going to be more of a drain on resources than a standalone app.

Let me make an imaginary example, suppose I develop some new hardware that connects to the USB port of a PC. Now, after I connect my USB-device, I run my application. (The app should NOT have a GUI, but behave similar to an IM program, sitting on the taskbar)

Via a browser, you can interact with my USB device. Now, after 30 mins or so, I turn off the program, unplug my USB and move to another system. I don't want any garbage left behind on the first PC.

None of that requires a webserver and I'd be pretty pissed if I plugged in a USB device and it started up some custom webserver.
 

chronodekar

Senior member
Nov 2, 2008
721
1
0
Thanks for all the replies guys.

MrChad,
Now that I think about it, you are right. A webserver IS more resource draining than a stand-alone app. But an app limits its functionality to the current user. If you are on another system, then no luck. But, with a webserver and a browser, you are not limited by OS.

KB,
I know I did mention Mono, but for making a web-page, I'd rather use PHP/Perl/Python or the like. Still, I'm going to look at your link, it might change my mind.

Nothinman,
I'd be pretty pissed if I plugged in a USB device and it started up some custom webserver.
Autorun was not my intention and I'd be annoyed in that scenario too. But I didn't know that you could start services in Windows without a reboot. Information to me. :)

DaveSimmons,
XAMPP looks VERY interesting. I need more time to read through it.

I'll update you guys here as I proceed. Thanks again !!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
MrChad,
Now that I think about it, you are right. A webserver IS more resource draining than a stand-alone app. But an app limits its functionality to the current user. If you are on another system, then no luck. But, with a webserver and a browser, you are not limited by OS.

Not totally true, you can have that be remote controlled and OS independent. It'll take a bit more work cause you'll have to design one end as a server and one as a client. But things like mmc, SSMS, etc on Windows don't all use a webserver.

Autorun was not my intention and I'd be annoyed in that scenario too. But I didn't know that you could start services in Windows without a reboot. Information to me.

Autorun would only add salt to the wound, too many things already come with their own version of crap like tomcat and I hate them all.
 

rex3055

Banned
Apr 9, 2009
1
0
0
Hi chronodekar,

I think this company name Gatewaytechnolabs.com provides custom software development services they have good expertise in the area of .NET webserver development so check this site it may help you lot!!

---

Good bye, and thanks for all the spam.

Harvey
Senior AnandTech Moderator
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
I don't think I would trust a development company that advertises with shameless plugs on an interweb message board.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Can't get away with much of that crap when Harvey's on the prowl. Seems we've had a rash of them the last couple of days.

To Chrono's point, there are lots of devices that have their own webserver in firmware or software. Pretty much every router is one. Slingboxes, HD Homerun, that sort of thing. The benefits fade away when you're installing on a specific desktop or laptop platform, because those are already full-featured interactive OS's with all the GUI stuff built in. If you wanted something simple and cross platform just doing it in Java would probably make more sense.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,700
4,661
75
So, if I understand correctly, what you're looking for is a simple webserver that can interface with another program.

There are many simple web servers. All that's needed for a very basic web server is to open a listening socket, listen to an HTTP request, and return at least a semi-valid HTTP response. I once modified a program I worked on in school to return a 404 to any HTTP request, in about 150 lines of C - and it forks a new process to return each response.

A web application isn't like a standalone GUI. How precisely do you plan to have your web user interact with your local program? Maintaining a session (knowing that request C comes from the same user as request A, but not as request B, for instance) is one of the biggest low-level challenges in web programming. Would you want to run a .NET executable each time a request comes in? If so, you can do that easily with CGI.

Otherwise, you can have your web server maintain a session; but then how do you plan to communicate with the .NET application? Pipes? Other TCP commands?

Alternatively, you could write the .NET application as an HTTP service, e.g. with SOAP. Then you could develop a web interface entirely based on Javascript, served with nothing more complex than my little C program, and with XmlHTTPRequests going straight to your .NET app. Here your .NET app is a server, but servicing only very simple commands, and not returning full HTML unless you want it to.
 

chronodekar

Senior member
Nov 2, 2008
721
1
0
Originally posted by: Ken g6
Alternatively, you could write the .NET application as an HTTP service, e.g. with SOAP. Then you could develop a web interface entirely based on Javascript, served with nothing more complex than my little C program, and with XmlHTTPRequests going straight to your .NET app. Here your .NET app is a server, but servicing only very simple commands, and not returning full HTML unless you want it to.

Most interesting. I need time to think on this. Thanks!