简体   繁体   中英

How can I publish a web page from a Windows Forms application? (C#)

I wish to build a Windows application that will generally run in the background, but have a configurable front-end Windows Forms GUI. I also would like this program to publish a small web page which can be accessed from other machines/devices and interact or call functions of the server application.
I'd rather not deploy a full-fledged ASP.NET web site with IIS, etc. I just need something simple.

So how would I go about doing this?

Take a look at Kayak . It's a relatively small and lightweight HTTP server that you can embed into your application and should provide all the functionality you're looking for.

FWIW, I am in no way associated with this project.

Maybe it's just because i've been doing asp dev for years, but I really think you should go the iis asp route as its very simple and built into windows. I can't imagine a more straightforward way of serving a webpage that has c# behind it to programmatically effect the host system.

Thanks to Kev in the comments on my question, he pointed me to this question , in which I found a link to a lightweight C# HTTP server component I could just drop in to my application: http://webserver.codeplex.com/

Works well for little stuff like I was doing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM