使用C#在localhost中托管网页 [英] Host a web page in localhost using C#

查看:156
本文介绍了使用C#在localhost中托管网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个需要通过本地网络报告进度的应用程序,我正在考虑使用一个简单的HTML页面来执行此操作但是如何在本地网络上托管它以便其他计算机可以访问它同一个网络。我正在玩ISS,但这也将在全新安装的Windows 8上运行(其中一些没有启用ISS)。有没有办法实现这个目标?





一如既往,感谢您的帮助!

I've made an application that needs to report progress over the local network, I was thinking of using a simple HTML page to do this but how do I host this on the local network so that it is accessible by other computers on the same network. I was playing around with ISS but this would also be run on brand new installs of Windows 8 (Some of which don't have ISS enabled). Is there any way to achieve this?


As always, thanks for any help!

推荐答案

您正在谈论的Web服务器是Internet信息服务(IIS),它随Windows操作系统一起提供,但默认情况下未安装。以下链接将指导您从安装到建立网站。但只是一个简短的,您只需要一台计算机作为Web服务器,即IIS,然后其他客户端计算机将使用浏览器访问该网站。



http://windows.microsoft.com/en-SG/ windows-8 / internet-information-services-iis-8-0
The web server you are talking about is Internet Information Services (IIS), it comes with your Windows OS but not installed by default. The following link will walk you through from installation to putting up a website. But just a brief one, you only need one computer to be the web server, that is the IIS, then other client computers will access the website using a browser.

http://windows.microsoft.com/en-SG/windows-8/internet-information-services-iis-8-0


您可以直接在您的应用程序中嵌入Web服务器,C#中有大量HTML Web服务器示例,如: C#中的简单HTTP服务器 [ ^ ]。这些可以直接放在你的应用程序中。



有关CP和网络的更多文章关于为简单的HTML页面制作自己的Web服务器。
You could embed a webserver directly in your application, there are numerous examples of HTML web servers in C#, like: Simple HTTP Server in C#[^]. These can be placed directly in your application.

There are more articles on CP and on the web about making your own web server for simple HTML pages.


这篇关于使用C#在localhost中托管网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆