随笔分类 - C#
摘要:using System.Net; /// /// 获得广播地址 /// /// IP地址 /// 子网掩码 /// 广播地址 public static string GetBroadcast(string ipAddress, string subnetMask) { byte[] ip = IPAddress.Parse(ipAd...
阅读全文
摘要: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...
阅读全文
摘要:if (e.KeyCode == Keys.Enter) { this.SelectNextControl(this.ActiveControl, true, true, true, true); }
阅读全文
摘要:Codeclass DES { /// <summary> /// Call this function to remove the key from memory after use for security /// </summary> /// <param name="Destination"></param> //...
阅读全文
摘要: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...
阅读全文
摘要:System.IO.Ports.SerialPortcom=newSystem.IO.Ports.SerialPort("com3");com.Open();com.WriteLine("P");com.Close();//是不是很简单
阅读全文
摘要://需求引用控件“Interop.SpeechLib.dll”//代码如下:SpVoicem_spVoice=newSpVoice();m_spVoice.Speak("你好",SpeechVoiceSpeakFlags.SVSFlagsAsync);//是不是很简单
阅读全文
摘要:String url="http://www.163.com";String domain=Regex.Match(url, @"(?<=://)[a-zA-Z\.0-9]+(?=\/)").Value.ToString();
阅读全文
摘要:关于DataGridView中DataGridViewCheckBoxCell 控制选中,以下是单选实现,需要设置该列readonly属性为ture,否则只有当选中其他时才会有反应!以下部分代码 dgv.CommitEdit(DataGridViewDataErrorContexts.Commit);DataGridViewCheckBoxCellchktmp=(DataGridViewCheckBoxCell)dgv.Rows[e.RowIndex].Cells["chk"];if(!(bool)chktmp.FormattedValue){chktmp.Value=tr
阅读全文
摘要:Thread 类提供了IsBackground { get; set;} 的布尔属性。当前台线程还在运行时,它会阻止进程被终止。另一方面,一旦所指的进程中不再有前台线程,后台线程就会被CLR自动终止(调用Abort()方法)。IsBackground的默认值为false,这意味着所有的线程默认况处于前状态。
阅读全文
摘要:SQL Server 数据库附加分离类
阅读全文