![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c#
灰鸟会灰
这个作者很懒,什么都没留下…
展开
-
将十六进制数转换成十进制数
class Program { void ConvertToHex() { double n = 0; Console.Write("输入十六进制数:"); string s = Console.ReadLine().ToLower();原创 2009-09-18 16:45:00 · 1944 阅读 · 0 评论 -
DES加密 c++ C#
#pragma onceclass MyDES{public:MyDES(void);~MyDES(void);public: BYTE bOriMsg[8] ; // 初始消息 ( 64 bit ) BYTE LMsg[17][4], RMsg[17][4] ; // 中间变量L0-->L16,R0-->R16 ( 32 bit原创 2017-07-12 14:26:01 · 1084 阅读 · 0 评论 -
c#操作Excel图表----备份用
public class ExcelHelper { [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID); protected voi原创 2015-03-12 17:14:41 · 1491 阅读 · 0 评论 -
winform ListView 扩展:1.失去焦点后保持选中行高亮;2.分组折叠
失去焦点后保持选中行高亮: public class ListViewEx : ListView { public ListViewEx() { GotFocus += new EventHandler(listView1_GotFocus); LostFocus += new EventHandler(转载 2014-08-14 15:39:18 · 5144 阅读 · 1 评论 -
C# 错误整理,不定期更新
TCPListener Stop后,端口没有释放解决:方案一:将Client关闭 二:使用线程打开,然后释放线程 三:使用GC.Collect原创 2010-12-24 12:57:00 · 763 阅读 · 0 评论 -
TCP 通用类
<br />参考网上写的,希望大家多提意见<br /> <br /> public class TCPSvr { TcpListener listener; Socket sorket; public Hashtable ht = new Hashtable(); /// <summary> /// 接收到客户端连接时发生 /// </summary> publ原创 2010-09-07 15:01:00 · 1794 阅读 · 0 评论 -
DataGridView 自定义排序,对多列尤其简单。
先创建一个静态类,用以实现扩展方法Sort。 public static class MySort{ public static void Sort(this DataGridView dgv, Comparison comparison) { dgv.Sort(new RowCompare(comparison)); } public class RowCompare : IComparer原创 2010-09-07 16:29:00 · 15101 阅读 · 5 评论 -
抽象工厂模式与生成器模式比较
<br />抽象工厂:<br />interface IBag { int Price { get; } } interface IBrand { int Price { get; } string Material { get; } } class Nike : IBrand{ public int Price { get { return 1000; }原创 2010-08-31 09:03:00 · 1126 阅读 · 0 评论 -
c# 摄像头录像 及视频保存压缩等
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Drawing;using System.Runtime.InteropServices;using System.Threading;using System.Windows.Forms;using System.IO;namespace Basic{ public class VideoAPI //视频API原创 2010-06-13 10:23:00 · 9871 阅读 · 8 评论 -
DataGridView导出Excel
<br /> public class ExcelHelper<br /> {<br /> static ExProgress progress = new ExProgress("正在导出数据");<br /> <br /> /// <summary><br /> /// 把DataGridView的数据导出到Excel<br /> /// </summary><br /> /// <param name="dgv">原创 2010-06-13 09:37:00 · 945 阅读 · 0 评论 -
C#曲线图
public class Curve2D:DrawingChart { #region 私有成员 private Graphics objGraphics;//Graphics 类提供将对象绘制到显示设备的方法 private Bitmap objBitmap;//位图对象 private float fltWidth = 480;//图像宽度 private float fltHeight = 248;//图像高度转载 2010-06-13 09:31:00 · 3370 阅读 · 2 评论 -
c# 对称加密算法类
<br />using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Text;<br />using System.Security.Cryptography;<br />using System.IO;<br />namespace Basic.Security<br />{<br /> /// <summary><br /> /// 对称加密算法类<br />转载 2010-06-13 10:35:00 · 712 阅读 · 0 评论 -
DataGridView打印类
<br /> public class DataGridViewPrinter<br /> {<br /> // The DataGridView Control which will be printed<br /> private DataGridView TheDataGridView;<br /> // The PrintDocument to be used for printing<br /> private PrintDocumen转载 2010-06-13 09:00:00 · 1113 阅读 · 0 评论 -
c# 读取串口——如何全部读取
public byte[] Read() { byte[] inbuffer = null; if (serialPort.IsOpen && serialPort.BytesToRead > 0) { try {原创 2010-02-05 16:24:00 · 6145 阅读 · 1 评论 -
mysql 表数据转到SqlServer
DBConnInfo conn1 = new DBConnInfo() { dbName = "it9520_std_v33", dbType = DBMSType.MySQL, host = "192.168.2.1", user = "root", pwd = "123 var db1 = new DbOperation(conn1); DB原创 2017-07-13 16:43:52 · 1008 阅读 · 0 评论