09 2019 档案
摘要:<DataGrid Name="date_grid" Grid.Column="0" ItemsSource="{Binding PortinfoList}" RowHeaderWidth="0" CanUserAddRows="False" AutoGenerateColumns="False">
阅读全文
摘要:方法1:使用左移和右移 int转化为byte[]: public byte[] intToBytes(int value) { byte[] src = new byte[4]; src[3] = (byte)((value >> 24) & 0xFF); src[2] = (byte)((valu
阅读全文
摘要:string input = "Hello World!"; char[] values = input.ToCharArray(); foreach (char letter in values) { // Get the integral value of the character. int
阅读全文
摘要:在WPF应用中,如果遇到多线程的需求时,如果引用WPF控件时会引发异常,异常内容:调用线程无法访问此对象,因为另一个线程拥有该对象。具体如下: 调用代码: ThreadcountThread= new Thread( new ThreadStart(Count)); countThread.Star
阅读全文
摘要:两者区别是 Timer在非UI线程跑的,DispatcherTimer是在UI线程跑的, DispatcherTimer 可以直接更新UI Timer必须使用this.Dispatcher.BeginInvoke去更新UI private void DisPatcherTimerMethod() {
阅读全文