摘要:
1.XML帮助类 public class XmlHelper { public static string GetElementByName(string xmlFileName, string tagName) { try { string result = null; XmlDocument 阅读全文
摘要:
给系统添加日志后,在系统出错时,可以通过日志查看请求的接口,向接口发送的数据,以及接口数返回的数据,请求时花费的时间,方便排查问题。 1.日志类 WMSLog.cs /// <summary> /// 日志类 /// </summary> public class WMSLog { //日志文件所在 阅读全文
摘要:
1.语音播放如果不做处理的话,程序只能等待语音播放完才进行下一步动作。 SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer(); Task.Factory.StartNew(() => { speechSynthesizer.Spe 阅读全文
摘要:
nuget引用WpfAnimatedGif xaml使用 <Image gif:ImageBehavior.AnimatedSource="/Images/请授权.gif" Stretch="Fill" /> 阅读全文
摘要:
1.引用System.Speech.dll 简单使用 SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer(); speechSynthesizer.Speak("欢迎使用"); 2.具体语音播放教程文档 https://www.wp 阅读全文
摘要:
1.获取本机Mac地址 ///<summary> /// 通过NetworkInterface读取网卡Mac ///</summary> ///<returns></returns> public static List<string> GetMacByNetworkInterface() { Li 阅读全文
摘要:
这个例子是向后台发送卡号机器码以及mac地址获取地磅的设置信息 1.请求数据时需要发送的字段 LoadometerSettingByAccessCardPacket.cs nuget引入 Newtonsoft.Json.dll public class LoadometerSettingByAcce 阅读全文
摘要:
1.无人地磅具有语音提示的功能,所以需要根据时间段设置电脑音量大小 2.user32.dll从网上下载下来后需要放入根目录 3. [DllImport("user32.dll")] public static extern IntPtr SendMessageW(IntPtr hWnd, int M 阅读全文
摘要:
1.这个开关直接监听串口是没有用的,需要向串口发送数据,然后再监听判断哪一个按钮被按下 2.开关的配置文件配置在xml文件里 3.读取xml类 public class XmlHelper { public static string GetElementByName(string xmlFileN 阅读全文
摘要:
/// <summary> /// Image 转成 base64 /// </summary> /// <param name="fileFullName"></param> public static string ImageToBase64(string fileFullName) { try 阅读全文