摘要: (转载)C#---WINCE 电池状态(2011-08-18 14:26:20)转载▼标签: wince电池电量状态c类杂谈 分类: 计算机程序设计 using System;using System.Collections.Generic;using System.Runtime.InteropServices;using System.Drawing;namespace BatteryControl{ /// /// Author /// Date /// Addr /// Func Battery Show /// public... 阅读全文
posted @ 2014-03-27 20:48 哈哈好玩 阅读(150) 评论(0) 推荐(0) 编辑
摘要: wmi的Win32_Battery类实现其中EstimatedChargeRemaining属性返回剩余电量的百分比,EstimatedRunTime属性返回剩余时间(分钟)其他属性参考http://msdn2.microsoft.com/en-us/library/aa394074.aspx我写了一个示范代码返回剩余电量的百分比首先在引用里添加System.Management核心代码如下:using System.Management;....ObjectQuery oq = new ObjectQuery("select * from Win32_Battery"); 阅读全文
posted @ 2014-03-27 20:40 哈哈好玩 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/baileng8/p/3402711.html1.从剪贴板中取数据using System.Windows.Forms;IDataObject iData = Clipboard.GetDataObject(); if (iData.GetDataPresent(DataFormats.Text)) { MessageBox.Show((string)iData.GetData(DataFormats.Text)); } else MessageBox.Show("目前剪贴板中数据不可转换为文本","错误&quo 阅读全文
posted @ 2014-03-26 09:53 哈哈好玩 阅读(3385) 评论(0) 推荐(1) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Net;using System.Web;using System.Web.Services.Description;using System.CodeDom;using Microsoft.CSharp;using System.CodeDom.Compiler;using System.Reflection;namespace Yom.Framework.Core{ public class WebS... 阅读全文
posted @ 2014-03-25 17:44 哈哈好玩 阅读(288) 评论(0) 推荐(0) 编辑
摘要: LDAP 阅读全文
posted @ 2013-10-23 12:07 哈哈好玩 阅读(685) 评论(0) 推荐(0) 编辑
摘要: Repository层设计的文章见:【http://www.cnblogs.com/yomho/p/3297042.html】 一、概要设计上面Reposity应该为 Repository特此更正,也不打算作图更正了。 二、业务Server层业务层Server是承Repository层,启UI层的重要层,UI层的数据和Repository层的数据传递必须经过它业务层的扩展非常必要所以采用IServer的设计方式接口设计如下: 1 namespace Yom.NFramework2_0 2 { 3 public interface IServer 4 where TEnt... 阅读全文
posted @ 2013-09-08 13:57 哈哈好玩 阅读(1822) 评论(0) 推荐(0) 编辑
摘要: 经过了上篇IRepository和IRepository的讨论【文章地址为:http://www.cnblogs.com/yomho/p/3296759.html】我选择了IRepository作为我重构框架的仓储接口一、接口定义新的IRepository接口设计如下: 1 namespace Yom.NFramework2_0 2 { 3 public interface IRepository 4 where TCompositeKey : IEquatable 5 { 6 #region 实体操作接口 7 T FindBy(... 阅读全文
posted @ 2013-09-02 23:11 哈哈好玩 阅读(2839) 评论(5) 推荐(0) 编辑
摘要: 前言对于仓储Repository的设计,其实很多人都很纠结,因为从广义来说,Repository有两种类型:IRepository和IRepository框架的重构想得最多的最重要的几个问题:1:解耦(每层可以替换其他的,比如换一个UI层可以把Web 项目快速转换成Winform项目)2:扩展性(可以灵活抹去框架的某个层,让其他的第三方框架依据自己的接口实现该层的逻辑,其它层不变,也就是插拔式扩展)3:灵活(开发便捷,使用灵活)4:维护性(别人了解框架后,可以让别人无障碍维护)........-------------------------------------题外话不多说 马上进入辩证主 阅读全文
posted @ 2013-09-02 16:21 哈哈好玩 阅读(6021) 评论(2) 推荐(3) 编辑
摘要: 1 public abstract partial class TListPager : UserControl 2 where TEntity:Yom.Extend.Entity.EntityBase 3 where TRepository : Yom.Extend.Repository.RepositoryBaseRepository 4 where TSqlStrConstruct : Huawei.Data.SqlStrConstruct 5 { 6 protected TRepository rep... 阅读全文
posted @ 2013-08-28 14:32 哈哈好玩 阅读(552) 评论(1) 推荐(0) 编辑
摘要: 1 class SmtpEmail 2 { 3 SmtpClient smtpclient; 4 MailMessage msg; 5 Attachment attachment; 6 public void sendMail(String form, String[] to, String subject, String body, String attachmentpath) 7 { 8 if (to == null || to.Length <= 0) { 9 ... 阅读全文
posted @ 2013-08-21 10:28 哈哈好玩 阅读(264) 评论(0) 推荐(0) 编辑