随笔分类 - C#
求解基本四则字符串算术表达式
摘要:求解基本四则字符串算术表达式 一、解析字符算术表达式 一段正确的字符串表达式会包含以下几种形式的独立操作符 操作符:+(,-(,(,),+,-,*,/ 操作符(数):1,1.1,-1,+1,1e1,1E1,1e-1,1e+1,1E-1,1E+1 可以将它们分为三类 A. +,- B. 操作符(数)
阅读全文
键盘鼠标(PS2)模拟器驱动及Demo
摘要:详情 KeyboardMouseSimulateDriver 问题描述: 鼠标相对移动存在不正确性,绝对移动没正确性. 基于于Thinkpad E460上的开发及测试. 不支持HID设备.
阅读全文
标记下 'net 查壳/脱壳/加壳' 工具
摘要:net查壳工具 DotNet Id v1.0.0.3 该net程序集被“MaxToCode”加壳了(也不能完全相信)。 加壳工具就是列表中列出的了。 de4Net.exe脱壳工具版本de4dot-v3-1.
阅读全文
C# (灰度)加权平均法将图片转换为灰度图
摘要:private Bitmap ToG(string file) { using (Bitmap o = new Bitmap(file)) { Bitmap g = new Bitmap(o.Width, o.Height); for (int i =...
阅读全文
C# GMap下提供一个高德地图
摘要:using System; using GMap.NET.Internals; using GMap.NET.Projections; namespace GMap.NET.MapProviders { public class AMapProvider : AMapProviderBase { private readonly string name = "A...
阅读全文
C# DataTable中根据某Column值(不重复)获取该值所在行
摘要:System.Data.DataTable dt = new System.Data.DataTable(); dt.PrimaryKey = new System.Data.DataColumn[] { dt.Columns["name"] }; System.Data.DataRow row = dtDW.Rows.Find(value); ...
阅读全文
C#,C++修改vs文件模板,添加自定义代码版权版本信息
摘要:简单型的修改类似该路径下的模板文件即可(vs版本或安装路径不同路径可能不同) C#: 模板参数参考https://msdn.microsoft.com/zh-cn/library/eehb4faa.aspx 例如添加如下内容 参数的值太长,不合适,如果有最好,可惜默认的没有,
阅读全文
C#利用AxImp工具在WPF中使用OCX控件
摘要:一、注册OCX并利用工具生成dll 二、添加引用(OCX生成的dll)并编码使用 项目引用:WindowsFormsIntegration.dll,System.Windows.Forms.dll 或cs代码使用 所用工具:http://pan.baidu.com/s/1i4AIBxr
阅读全文
C# 实现 微软WebRequestMethods.Ftp类中的FTP操作功能
摘要:先奉献一个测试地址,ftp内的文件请勿删除,谢谢FtpEntity fe = new FtpEntity("wjshan0808.3vhost.net", "wjshan0808", "1234567890");由于代码量较多,只抽出一部分,详细代码请移步 ftp://wjshan0808.3vho...
阅读全文
C# “快捷方式” 实现程序开机启动
摘要:添加引用:COM : Windows Script Host Object ModelName: Interop.IWshRuntimeLibrary添加命名空间:using IWshRuntimeLibrary; public static int StartUpByShortCut...
阅读全文
C# UDP 连接通信 简单示例
摘要:Udp.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.Net.Sockets;namespace udp{ pu...
阅读全文
C# 对象的序列化与反序列化 (DataContractJsonSerializer)
摘要:项目引用System.Runtime.Serialization.dll添加命名空间using System.Runtime.Serialization.Json;1.序列化对象,得到Json字符串 public static string WriteFromObject(T obj)...
阅读全文
C# App.config文件配置数据的读写
摘要:添加程序集引用 System.configuration.dll 和命名空间 using System.Configuration;读:ConfigurationManager.AppSettings["节点名称"]写:Configuration config = ConfigurationMana...
阅读全文
在SQLite Expert上用日期类型字段作为条件查询时注意日期的格式化
摘要:经验之谈:情况一:没有查询结果select * from t_Records where 1==1 and R_CheckInTime > '2015-7-12 18:47:00' and R_CheckInTime '2015-07-12 18:47:00' and R_CheckInTim...
阅读全文
SQLite Expert 删除表数据并重置自动增长列
摘要:用下面的语句肯定是行不通的,语句不支持truncate table t_Records方法:1.删除表数据delete from t_Records where 1==12.重置自动增长列update sqlite_sequence set seq=0 where name='t_Records' ...
阅读全文
C# TreeView的CheckBox 父/子节点点击联动选择效果
摘要:注: 点击时请正常速度点击,不然会出现“奇怪”现象!!! /// /// 节点点击 子级->同级->父级 /// /// /// private void tvRoles_AfterCheck(objec...
阅读全文
With as 递归查询
摘要:use TESTcreate table Provinces( pro_Id int primary key identity(1,1), pro_Name nvarchar(255), pro_Code nvarchar(8), pro_PId int) exec sp_r...
阅读全文
ServiceController1
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u...
阅读全文