文章分类 - C#
摘要:找了半天有个总结:https://www.markheath.net/post/nodriver-calling-acmformatsuggest# 用MediaFoundationReader 可以播放,但是不支持传入字节流老播放。 后面发现用这个也能解决,不知道是否通用: string file
阅读全文
摘要:在C#中执行JavaScript代码通常不是直接支持的,因为C#和JavaScript是两种完全不同的编程语言,运行在不同的运行环境中。然而,你可以通过一些方法间接地在C#中执行JavaScript代码。 使用浏览器控件(如WebBrowser或WebView2): 你可以在Windows Form
阅读全文
摘要:准备使用微软的EDGE组件,需要静音,按照文档webView.CoreWebView2.IsMuted = true;发现不起作用。。。https://github.com/MicrosoftEdge/WebView2Feedback/issues/2120 又说下个版本修复。等不及了。 这里看到一
阅读全文
摘要:c#调用次世代AntiVC.dll 完整实例 复杂验证码识别 有完整的例子 string code; //************* //URL 识别 code = avc.GetVcodeUrl("http://bbs.ent.163.com/bbs/checkcode.jsp?120135968
阅读全文
摘要:ListVIew 为ItemsControl,任何属于ItemsControl的控件,DataGrid,ListBox等 ,都默认支持ScrollViewer的,不需要特定去修改它。
阅读全文
摘要:网上找了下全是PHP或者JS 的,自己写了个C#的: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Security.Cryptography; names
阅读全文
摘要:WPF C# 序列化保存设置,BinaryFormatter
阅读全文
摘要:C# MD5 32位加密 UTF-8编码 public static string GetMD5(string str) { byte[] b = System.Text.Encoding.Default.GetBytes(str); b = new System.Security.Cryptogr
阅读全文
摘要:UPW ListView 下拉刷新方法-通过访问ListView内部的ScrollViewer控件,来监听ViewChanged事件。(直接测试有效) 访问ListView内部的ScrollViewer,必定离不开VisualTreeHelper类中的以下两个方法: public static De
阅读全文
摘要:这个方案不是太好,但是可以应付: 另外可以参考Microsoft.Xna.Framework.Audio 下的 SoundEffect ,SoundEffectInstance效果更好 using System; using System.Collections.Generic; using Sys
阅读全文
摘要:<UserControl x:Class="TestCutPic.CutItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winf
阅读全文
摘要:用第三方DLL, 基于ICSharpCode.SharpZipLib.dll的封装,
阅读全文
摘要:一个类来编码URL ,.net 自带的 HttpUtility.UrlEncode, Uri.EscapeUriString 都不能满足超长度的字符串编码,根据官方文档知道 stringToEscape 的长度超过 32766 个字符。https://msdn.microsoft.com/zh cn
阅读全文
摘要:Task有时候相当于Thread的作用 下面的例子test2 是个带参数和返回值的函数。 private int test2(object i){ this.Invoke(new Action(()= {pictureBox1.Visible=true;})); System.Threading.T
阅读全文