摘要: 1. 使用 Winform 的 PictureBox 1.1 引用 dll WindowsFormsIntegration.dll System.Windows.Forms.dll System.Drawing.dll 1.2 XMAl代码 <Window x:Class="TestGif.Main 阅读全文
posted @ 2021-03-08 21:55 鑫茂 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 以下 F:/Debug/xx.exe 为客户端路径。 1. Web 调用 1.1 IE 内核的浏览器调用方式 js 函数调用如下: var a=new ActiveXObject("Wscript.Shell"); a.exec("F:/Debug/xx.exe params");(格式是:exe 阅读全文
posted @ 2021-03-08 21:47 鑫茂 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1. base64 转图片 将 base64 转成 byte[] 将 byte[] 作为内存流保存到一个 BitmapImage 实例的流的源 把 BitmapImage 作为目标图片的 Source byte[] streamBase = Convert.FromBase64String(imag 阅读全文
posted @ 2021-03-08 21:46 鑫茂 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 1. 功能 系统截图。 2. 实现 2.1 思路 控件继承自 System.Windows.Media.Visual, 通过 System.Windows.Media.Imaging.RenderVisualToBitmap 把 Visual 对象转换为位图 rtb 将位图转成编码器接受的一帧,类型 阅读全文
posted @ 2021-03-08 21:45 鑫茂 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 1. 前提 原本是在大屏上展示系统,系统有个功能是加载第三方的网站,第三方网站按照大屏的分辨率写死了宽高; 现需要改到小屏展示系统,而这个第三方的网站不能随着 WebBrowser 窗口的尺寸调整网站内容的尺寸。 2. 解决思路 1)加载完毕后,调用 InvokeScript 方法执行在当前加载的文 阅读全文
posted @ 2021-03-08 21:43 鑫茂 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1. 拖拽窗体 使用 System.Windows.Window 自带的 DragMove() 方法即可识别窗体拖动。 DragMove(); 2. 拖拽控件:复制、移动控件 <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> 阅读全文
posted @ 2021-03-08 21:41 鑫茂 阅读(796) 评论(0) 推荐(0) 编辑
摘要: 1. 库类: \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.dll System.Net.HttpListener 2. 代码 2.1 服务端 class Program { static HttpListen 阅读全文
posted @ 2021-03-08 21:38 鑫茂 阅读(3257) 评论(0) 推荐(0) 编辑
摘要: 1. 代码 /// <summary> /// 文件上传下载控制器 /// </summary> public class FileController : ApiController { /// <summary> /// 上传文件 /// </summary> /// http://192.16 阅读全文
posted @ 2021-03-08 21:36 鑫茂 阅读(625) 评论(0) 推荐(0) 编辑
摘要: 库类: Owin.dll Owin.IAppBuilder Microsoft.Owin.dll Microsoft.Owin.OwinContext Microsoft.Owin.Hosting.dll Microsoft.Owin.Hosting.WebApp Microsoft.Owin.Ho 阅读全文
posted @ 2021-03-08 21:34 鑫茂 阅读(571) 评论(0) 推荐(0) 编辑
摘要: helper 类封装 调用 1. 引用的库类 \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.dll System.Net.HttpWebRequest 2代码 helper 类封装 /// <summary> 阅读全文
posted @ 2021-03-08 21:32 鑫茂 阅读(919) 评论(0) 推荐(0) 编辑
摘要: 1. 示例代码 using System; using System.IO; using System.Net.Http; /// <summary> /// 下载文件 /// </summary> /// <param name="serverFileName">服务器上文件名 如 close.p 阅读全文
posted @ 2021-03-08 21:30 鑫茂 阅读(8108) 评论(0) 推荐(0) 编辑
摘要: 1. 需要的库类 \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Net.Http.dll System.Net.Http.HttpClient 2. 代码 public class HttpClientHe 阅读全文
posted @ 2021-03-08 21:27 鑫茂 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: 1. 需要的库类 \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll System.Net.WebClient 2. 代码 var wc = new WebClient(); var url = "htt 阅读全文
posted @ 2021-03-08 19:39 鑫茂 阅读(712) 评论(0) 推荐(0) 编辑
摘要: 1. 先在项目的 Settings.settings 新建需要的字段和类型 有需要还可设置初始默认值 2. 启动客户端时,获取 Properties.Settings 的属性值 public void Construct() { if (Properties.Settings.Default.IsR 阅读全文
posted @ 2021-03-08 19:26 鑫茂 阅读(399) 评论(0) 推荐(0) 编辑