WPF 使用HttpListener搭建本地web服务器

时间:2018-07-06 22:35:26   收藏:0   阅读:784

准备工作

using Micro.Listener 类(Micro.Listener.dll)下载

调用示例:
一、启动服务:new Micro.Listener.ListenerSync(8181).Start();

二、资源调用:
1、HTML:webBrower.Source = new Uri("http://localhost:8080/res/template.html");
2、CSS/JS:<link href="http://localhost:8080/res/style.css" rel="stylesheet" />
3、图片:<img src="http://localhost:8080/res/logo.png"/> 

 

 

Micro.Listener.dll 文件下载

 

Micro.Listener 源代码下载

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!