使用 C# 查看本地已连接的打印机

使用 C# 查询本地连接的所有打印机。下面介绍了2种方法。1 使用 EnumeratedPrintQueueTypesusing System;using System.Linq;using Syst...
2020-09-13 C# 评论 0

C# 解决 HttpListener 拒绝访问异常

问题描述在 Windows 10 中,使用 C# 的 HttpListener 监听 8081 端口。代码如下:try{ HttpListener listener = new HttpList...
2020-06-20 C# 评论 0

Newtonsoft.Json 对象序列化并设置首字母小写的2种方法

使用 C# 依赖 Newtonsoft.Json 的 JsonConvert.SerializeObject方法,将对象转换为 JSON 字符串,会按照对象的属性名称作为键输出,一般情况下属性名称是以...
2020-03-13 C# 评论 0

C# 无法从命令行或调试器启动服务,必须首先安装Windows服务

参考C#官方教程:创建 Windows 服务应用,搭建windows service项目。问题的出现使用 Visual Studio 2019 创建 C# windows 服务项目,尝试运行.exe的...
2020-02-27 C# 评论 0
MIP.watch('startSearch', function (newVal, oldVal) { if(newVal) { var keyword = MIP.getData('keyword'); console.log(keyword); // 替换当前历史记录,新增 MIP.viewer.open('/s/' + keyword, {replace: true}); setTimeout(function () { MIP.setData({startSearch: false}) }, 1000); } }); MIP.watch('goHome', function (newVal, oldVal) { MIP.viewer.open('/', {replace: false}); });