1、概念 1.0 线程的和进程的关系以及优缺点 windows系统是一个多线程的操作系统。一个程序至少有一个进程,一个进程至少有一个线程。进程是线程的容器,一个C#客户端程序开始于一个单独的线程,CLR(公共语言运行库)为该进程创建了一个线程,该线程称为主线程。例如当我们创建一个C#控制台程序,程序 Read More
posted @ 2018-01-07 08:52 slcands Views(663) Comments(2) Diggs(1) Edit
这个似乎是FTP下载的:#region "Download: File transfer FROM ftp server" /// <summary> /// Copy a file from FTP server to local /// </summary> /// <param name="sourceFilename">Target filename, if required </param> /// <param name="localFilename">Full Read More
posted @ 2011-08-23 09:42 slcands Views(327) Comments(0) Diggs(0) Edit
UDP的:namespace UDPServer{ class Program { static void Main(string[] args) { int recv; byte[] data = new byte[1024]; //构建TCP 服务器 //得到本机IP,设置TCP端口号 IPEndPoint ipep = new IPEndPoint(IPAddress.Any , 8001); So... Read More
posted @ 2011-08-23 09:37 slcands Views(425) Comments(0) Diggs(0) Edit
http://topic.csdn.net/u/20080623/08/4bbd2475-45f1-42e3-a613-16b094759ade.htmlSocket通讯:public class XmlSocket { //异步socket诊听 // Incoming data from client.从客户端传来的数据 public static string data = null; // Thread signal.线程 用一个指示是否将初始状态设置为终止的布尔值初始化 ManualResetEvent 类的新实例。 ... Read More
posted @ 2011-08-23 09:27 slcands Views(293) Comments(0) Diggs(0) Edit
/// 〈summary〉/// 汉字转拼音缩写/// 2004-11-30/// 〈/summary〉/// 〈param name="str"〉要转换的汉字字符串〈/param〉/// 〈returns〉拼音缩写〈/returns〉public string GetPYString(string str){ string tempStr = "";; foreach(char c in str) { if((int)c 〉= 33 && (int)c 〈=126) {//字母和符号原样保留 tempStr += c.ToString( Read More
posted @ 2011-08-04 13:00 slcands Views(238) Comments(0) Diggs(1) Edit
Test.csusing System;using System.Drawing;using System.Windows.Forms;using System.Runtime.InteropServices;using System.Reflection;namespace ColorCursor{/// <summary>/// 本例子的作用:/// 在.NET中实现彩色光标,动画光标和自定义光标。/// </summary>public class Form1 : System.Windows.Forms.Form{[DllImport("user32. Read More
posted @ 2011-08-04 12:56 slcands Views(157) Comments(0) Diggs(0) Edit
using System.Runtime.InteropServices;using System.Drawing;using System.Drawing.Imaging;namespace PickHead{/// <summary>/// 一个控制摄像头的类/// </summary>public class Pick{private const int WM_USER = 0x400;private const int WS_CHILD = 0x40000000;private const int WS_VISIBLE = 0x10000000;private Read More
posted @ 2011-08-04 12:55 slcands Views(477) Comments(0) Diggs(1) Edit
ColorMatrix (彩色矩阵) 类位于System.Drawing.Imaging命名空间 先看看下面的代码ColorMatrix cm = new ColorMatrix(new float[][]{ new float[]{0.5f,0.5f,0.5f,0,0},new float[]{0.5f,0.5f,0.5f,0,0},new float[]{0.5f,0.5f,0.5f,0,0},new float[]{0,0,0,1,0,0},new float[]{0,0,0,0,1,0},new float[]{0,0,0,0,0,1}});矩阵系数组成一个 5x5 的线性转换,用于转 Read More
posted @ 2011-08-04 12:51 slcands Views(273) Comments(0) Diggs(1) Edit
public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { System.Windows.Forms.Timer StopRectTimer = new System.Windows.Forms.Timer(); StopRectTimer.Tick += new EventHandler(timer1_Tick); StopRectTimer.Interval = 50; StopRect. Read More
posted @ 2011-08-04 12:48 slcands Views(227) Comments(0) Diggs(0) Edit
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace 图形动画...{ public partial class Form1 : Form ...{ public Form1() ...{ InitializeComponent(); } private void Form1_Load(object sender, Read More
posted @ 2011-08-04 12:46 slcands Views(943) Comments(0) Diggs(2) Edit