04 2020 档案
摘要:1. 104公约概况 使用tcp协议通信,标准tcp端口号是2404。服务端模拟软件可以使用gitbub上一个模拟器(IEC60870-5-104ServerSimulator.exe)。 2. 104公约数据结构 APCI Application Protocol Control Informat
阅读全文
摘要:<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/200
阅读全文
摘要:public partial class MainWindow : Window { private List<int> ShortTicks; private List<int> MiddleTicks; private List<int> LongTicks; private List<stri
阅读全文
摘要:<UserControl x:Class="wpf刻度线.TickBar" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/20
阅读全文
摘要:if (File.Exists(fileName)) { File.Delete(fileName); using (FileStream fs = new FileStream(fileName, FileMode.Create)) { StreamResourceInfo resource =
阅读全文
摘要:using System; using System.Data; using Excel= Microsoft.Office.Interop.Excel; namespace 读写excel { /// <summary> /// MainWindow.xaml 的交互逻辑 /// </summar
阅读全文
摘要:当wpf里设置边框的时候,如果是dynamicResource的话,有时候会不显示。 1.window里定义颜色,这时候不显示 <Window.Resources> <Color x:Key="red" R="255" G="0" B="0" A="255" /> <Color x:Key="blu
阅读全文
摘要:https://files.cnblogs.com/files/chlm/wpf%E5%BC%82%E6%AD%A5%E5%8A%A0%E8%BD%BD5w%E6%8E%A7%E4%BB%B6.rar
阅读全文
摘要:/// <summary> /// 由结构体转换为byte数组 /// </summary> public static byte[] StructureToByte<T>(T structure) { int size = Marshal.SizeOf(typeof(T)); byte[] buf
阅读全文
摘要:using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; using System.Text;
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using Excel = Microsof
阅读全文
摘要:1.什么时候用到invoke和beginInvoke --当调度线程不是主线程的时候 2.invoke和beginInvoke效率差别 测试方法:使用线程更新图片内容,此时,调度线程和非调度线程不是同一个,要用到封送处理(invoke或beginInvoke) Task.Factory.StartN
阅读全文
摘要:using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Reflection; using System.Runtime.InteropServices; usin
阅读全文
摘要:1.截图关键代码 public class ScreenShotHelper : MarshalByRefObject, IScreenShotHelper { public byte[] GetImage() { var wid = Screen.PrimaryScreen.Bounds.Widt
阅读全文
摘要:说明:源码引用于:https://github.com/mrjono1/FastExcel由于,源码不支持在excel中添加特殊符号,故做了改动。改动如下:cell.cs文件的 internal StringBuilder ToXmlString(SharedStrings sharedString
阅读全文
摘要:using iTextSharp.text; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.T
阅读全文
摘要:Socket s = null; IPEndPoint ipe = new IPEndPoint(IPAddress.Parse("192.168.1.3"), 999); Socket tempSocket = new Socket(ipe.AddressFamily, SocketType.St
阅读全文
摘要:IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, 111); Socket s = new Socket(endPoint.Address.AddressFamily, SocketType.Dgram, ProtocolType.Udp); /
阅读全文
摘要:关键代码 IntPtr notepadHandle =APPIntprt= _process.MainWindowHandle; int style = GetWindowLong(notepadHandle, GWL_STYLE); style = style & ~((int)WS_CAPTIO
阅读全文
摘要:使用TCD.System.TouchInjection.dll using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using Sy
阅读全文
摘要:<ec:PathListBox x:Name="numberPathListBox" IsHitTestVisible="False"> <ec:PathListBox.ItemTemplate> <DataTemplate> <TextBlock Foreground="White" Text="
阅读全文
摘要:using System; using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Controls; namespace 浏览器测试 { public class WebBrowserH
阅读全文
摘要:using System; using System.Diagnostics; using System.Management; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Sy
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Prog
阅读全文
摘要:using System; using System.IO; using System.Text; namespace Helper { public class EncodingHelper { public static Encoding GetType(FileStream fs) { byt
阅读全文
摘要:var url = "http:/xxx"; var credential = "fooClientIdPassword:secret"; var userName = "xx"; var pwd = "xx"; var base64Credential = Convert.ToBase64Stri
阅读全文
摘要:DrawingVisual drawingVisual = new DrawingVisual(); DrawingContext dc = drawingVisual.RenderOpen(); dc.DrawLine(new Pen(Brushes.Red,2),new Point(0,0),n
阅读全文
摘要:<Window x:Class="_temple.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/x
阅读全文
摘要:using System.Collections.Generic; using System.Windows; using System.Windows.Controls.Primitives; using System.Windows.Input; namespace WpfApp25 { ///
阅读全文
摘要:using System; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.
阅读全文
摘要:1. none <div style="background: url(2.jpg) 50% 50%/ auto auto no-repeat ; width: 1000px; height: 800px; border:1px solid blue;"/> 2. tile 填充 <div styl
阅读全文
摘要:默认windows并发数是2,所以可以设置此数大一点 ServicePointManager.DefaultConnectionLimit = 20; 也可以使用abort释放http连接 using System; using System.Collections.Generic; using S
阅读全文
摘要:public class LogHelper { private static readonly ReaderWriterLockSlim LogWriteLock = new ReaderWriterLockSlim(); private static readonly string LogFil
阅读全文