c#使用GDI+简单绘图(二)

// Create the in-memory bitmap where you will draw the image. // This bitmap is 300 pixels wide and 50 pixels high. Bitmap image = new Bitmap(300, 50); // get the graphics con …… 阅读全文

C#综合揭秘——细说多线程

//以下这个例子,就是通过Thread显示当前线程信息static void Main(string[] args){ Thread thread = Thread.CurrentThread; thread.Name = "Main Thread"; string threadMessage = string.Format("Thread ID:{0}\n Current App …… 阅读全文

C#综合揭秘——细说多线程(二)

/*异步写入FileStream中包含BeginWrite、EndWrite 方法可以启动I/O线程进行异步写入。public override IAsyncResult BeginWrite ( byte[] array, int offset, int numBytes, AsyncCallback userCallback, Object stateObject )public ov …… 阅读全文

C# 使用WinRar命令压缩和解压缩

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Diagnostics;using System.IO;public partial c …… 阅读全文

c# 图片转二进制/字符串 二进制/字符串反转成图片

protected void Button1_Click(object sender, EventArgs e) { //图片转二进制 byte[] imageByte = GetPictureData(Server.MapPath("./uploadfile/111.png")); //二进制转换成字符串 string pi …… 阅读全文

C#线程池多线程Socket通讯 服务器端和客户端示例

using System;using System.Net;using System.Net.Sockets;using System.Text;using System.Threading;namespace socket2016{ class Program { static void Main(string[] args) { …… 阅读全文

C#微信公众号/订阅号开发 接口源码

using System;using System.Web;using System.IO;using System.Text;using System.Web.Security;using weixin_api;public class wxgz_api : IHttpHandler{ public void ProcessRequest(HttpContext cont …… 阅读全文

c# Socket通讯中关于粘包,半包的处理,加分割符

using System;using System.Collections.Generic;using System.Text;using System.Net.Sockets;using System.Threading;namespace EventBase{ /*解决Socket的粘包处理 使用方法 A2DTcpClient client = …… 阅读全文