05 2011 档案

WPF学习笔记--向界面动态添加控件或者usercontrol
摘要: 在做工控业界面时,运行时添加和编辑界面元素会给程序带来更大的灵活性,同时更能增加用户体验的好评度。以下的例子代码实现:在应用程序界面需要更新时(如应用程序加载时)将存储于数据库的界面元素数据载入到UI当中,并且绑定一些事件或者菜单前台代码:<Canvas x:Name="AP_Plank" Height="3300" Width="2200"/>后台代码:/// <summary> /// 将所有基站添加到系统界面当中 /// </summary> void AddALlStationToUI() 阅读全文

posted @ 2011-05-29 00:40 badnewfish 阅读(376) | 评论 (0) 编辑

附加数据库失败,操作系统错误 5:"5(拒绝访问。)"的解决办法
摘要: 附加数据库失败,操作系统错误 5:"5(拒绝访问。)"的解决办法无法打开物理文件 XXX.mdf"。操作系统错误 5:"5(拒绝访问。)"。 (Microsoft SQL Server,错误: 5120) 找到xxx.MDF与xxx_log.LDF文件,右键-属性-安全-在组或用户名处添加Authenticated Users-更改该组权限为完全权限,再次附加成功。阅读全文

posted @ 2011-05-27 22:52 badnewfish 阅读(656) | 评论 (2) 编辑

事件和委托在通信编程中的应用
摘要: 封装后的socket类1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Text;4usingSystem.Net.Sockets;5usingSystem.Net;67namespaceSICOMSocket8{9publicclassSocketAsyncServer10{1112publicdelegatevoidProcessMessageeDelegate(SocketclientSock,byte[]msgBuff,DateTimegetDataTime);13publiceventProcessMessagee.阅读全文

posted @ 2011-05-19 23:33 badnewfish 阅读(55) | 评论 (0) 编辑

WPF学习笔记--运行时画图的实现
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Controls;using System.Windows;using System.Windows.Input;using System.Windows.Media;using System.Windows.Shapes;namespace Main.Ranging{ public class Ruler { public delegate void PolygonAddedDelegat阅读全文

posted @ 2011-05-19 23:23 badnewfish 阅读(148) | 评论 (1) 编辑

WPF学习笔记--一些新鲜的控件
摘要: System.Windows.Controls.ComboBox 之数据绑定:绑定到DataTableDataTable DTDepartments = new BLL.DepartmentT().GetAll();comboBoxAllDepartments.ItemsSource = DTDepartments.Rows;阅读全文

posted @ 2011-05-19 23:19 badnewfish 阅读(34) | 评论 (0) 编辑

C8500 丢失 串号A0000020C9DAA1
摘要: C8500 丢失 串号A0000020C9DAA1 地点:贼城西安 时间2011年05月11日阅读全文

posted @ 2011-05-12 09:54 badnewfish 阅读(42) | 评论 (0) 编辑