随笔分类 -  C#

摘要:using System.Net; /// /// 获得广播地址 /// /// IP地址 /// 子网掩码 /// 广播地址 public static string GetBroadcast(string ipAddress, string subnetMask) { byte[] ip = IPAddress.Parse(ipAd... 阅读全文
posted @ 2015-02-11 08:54 天纯蓝 阅读(3168) 评论(0) 推荐(0) 编辑
摘要:string t = DateTime.Now.Ticks.ToString(); t = DESKey.DESEncrypt(t, DESKey.DesKeyStr); string[] strid = new string[t.Length];// for (int i = 0; i < t.Lengt... 阅读全文
posted @ 2013-03-07 17:23 天纯蓝 阅读(2790) 评论(0) 推荐(0) 编辑
摘要:if (e.KeyCode == Keys.Enter) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } 阅读全文
posted @ 2012-06-30 15:42 天纯蓝 阅读(216) 评论(0) 推荐(0) 编辑
摘要:Codeclass DES { /// <summary> /// Call this function to remove the key from memory after use for security /// </summary> /// <param name="Destination"></param> //... 阅读全文
posted @ 2012-03-26 08:44 天纯蓝 阅读(261) 评论(0) 推荐(0) 编辑
摘要:线程运行超时处理类 阅读全文
posted @ 2012-03-14 14:05 天纯蓝 阅读(2883) 评论(0) 推荐(0) 编辑
摘要:文件帮助类 阅读全文
posted @ 2012-03-14 14:00 天纯蓝 阅读(298) 评论(0) 推荐(0) 编辑
摘要:取IP,判断IP是否合法 阅读全文
posted @ 2012-03-14 13:58 天纯蓝 阅读(687) 评论(0) 推荐(0) 编辑
摘要:Web HTTP Service 阅读全文
posted @ 2012-03-14 13:56 天纯蓝 阅读(485) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Collections.Specialized;using System.IO;using System.Net;using System.Text;using System.Web;namespace HttpServerDemo{ public class Http... 阅读全文
posted @ 2012-03-08 16:21 天纯蓝 阅读(1707) 评论(0) 推荐(0) 编辑
摘要:System.IO.Ports.SerialPortcom=newSystem.IO.Ports.SerialPort("com3");com.Open();com.WriteLine("P");com.Close();//是不是很简单 阅读全文
posted @ 2011-09-05 16:55 天纯蓝 阅读(505) 评论(0) 推荐(0) 编辑
摘要://需求引用控件“Interop.SpeechLib.dll”//代码如下:SpVoicem_spVoice=newSpVoice();m_spVoice.Speak("你好",SpeechVoiceSpeakFlags.SVSFlagsAsync);//是不是很简单 阅读全文
posted @ 2011-09-05 16:52 天纯蓝 阅读(482) 评论(0) 推荐(0) 编辑
摘要:String url="http://www.163.com";String domain=Regex.Match(url, @"(?<=://)[a-zA-Z\.0-9]+(?=\/)").Value.ToString(); 阅读全文
posted @ 2011-08-11 15:49 天纯蓝 阅读(535) 评论(0) 推荐(0) 编辑
摘要:关于DataGridView中DataGridViewCheckBoxCell 控制选中,以下是单选实现,需要设置该列readonly属性为ture,否则只有当选中其他时才会有反应!以下部分代码 dgv.CommitEdit(DataGridViewDataErrorContexts.Commit);DataGridViewCheckBoxCellchktmp=(DataGridViewCheckBoxCell)dgv.Rows[e.RowIndex].Cells["chk"];if(!(bool)chktmp.FormattedValue){chktmp.Value=tr 阅读全文
posted @ 2011-06-05 14:40 天纯蓝 阅读(676) 评论(0) 推荐(0) 编辑
摘要:封装的一个套接字----服务端 阅读全文
posted @ 2009-07-17 21:15 天纯蓝 阅读(388) 评论(0) 推荐(0) 编辑
摘要:Thread 类提供了IsBackground { get; set;} 的布尔属性。当前台线程还在运行时,它会阻止进程被终止。另一方面,一旦所指的进程中不再有前台线程,后台线程就会被CLR自动终止(调用Abort()方法)。IsBackground的默认值为false,这意味着所有的线程默认况处于前状态。 阅读全文
posted @ 2009-07-04 13:49 天纯蓝 阅读(245) 评论(0) 推荐(0) 编辑
摘要:理解Semaphore和Mutex 阅读全文
posted @ 2009-07-01 11:27 天纯蓝 阅读(664) 评论(0) 推荐(0) 编辑
摘要:SQL Server 数据库附加分离类 阅读全文
posted @ 2008-12-19 16:46 天纯蓝 阅读(255) 评论(0) 推荐(0) 编辑
摘要:随机读取记录 阅读全文
posted @ 2008-10-06 11:33 天纯蓝 阅读(338) 评论(0) 推荐(0) 编辑
摘要:HTML生成类 阅读全文
posted @ 2008-09-17 11:55 天纯蓝 阅读(339) 评论(1) 推荐(0) 编辑
摘要:C# 动态加载控件 阅读全文
posted @ 2008-06-11 16:41 天纯蓝 阅读(2231) 评论(0) 推荐(0) 编辑