风痕之月
type: channel
link: https://www.helj.top/
description: 就算跌倒，也要豪迈的笑
items: 密码清理
items: downloadfile
items: indexof
items: console
items: CV300EAPI
items: ET99API
items: ViKeyAPI
items: EmailHelper
items: FTPHelper
items: SqliteHelper

密码清理
type: item
date: 2018-09-30T16:17:21+08:00
description: win7以下版本打开文件夹C:\Windows\repair，选中sam，按CTRL＋C进行复制打开文件夹C:\Windows\system32\config ，将其中的SAM文件重命名（如SAM1210），然后按CTRL＋V进行粘贴完成替换之后重启计算机从硬盘启动，你就会发现登录Windows时不需要密码了win10 Or win server 2008修改Windows\System32\osk.exe 为 osk.exe.bak复制Windows\System32\cmd.exe并更名为osk.exe重启计算机，等待开机启动完毕，点击左下角的“轻松访问”按钮，在弹出对话框中勾选“不使用键盘键入（屏幕键盘）”，并点击“确定”（如图4）利用net user命令修改本地管理员账户的密码net users adminuser Password /add net localgroup administrators adminuser /add

downloadfile
type: item
date: 2018-09-30T16:13:09+08:00
description: /*===================下载文件 * options:{ * url:'', //下载地址 * data:{name:value}, //要发送的数据 * method:'post' * } */ var DownLoadFile = function (options) { var config = $.extend(true, { method: 'post' }, options); var $iframe = $(' '); var $form = $(' '); $form.attr('action', config.url); for (var key in config.data) { $form.append(' '); } $iframe.append($form); $(document.body).append($iframe); $form[0].submit(); $iframe.remove(); }

indexof
type: item
date: 2018-09-30T16:12:43+08:00
description: if (!Array.prototype.indexOf){ Array.prototype.indexOf = function(elt /*, from*/){ var len = this.length >>> 0; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); if (from < 0) from += len; for (; from < len; from++){ if (from in this && this[from] === elt) return from; } return -1; }; }

console
type: item
date: 2018-09-30T16:12:27+08:00
description: window._console = window.console;//将原始console对象缓存 window.console = (function (orgConsole) { return {//构造的新console对象 log: getConsoleFn("log"), debug: getConsoleFn("debug"), info: getConsoleFn("info"), warn: getConsoleFn("warn"), exception: getConsoleFn("exception"), assert: getConsoleFn("assert"), dir: getConsoleFn("dir"), dirxml: getConsoleFn("dirxml"), trace: getConsoleFn("trace"), group: getConsoleFn("group"), groupCollapsed: getConsoleFn("groupCollapsed"), groupEnd: getConsoleFn("groupEnd"), profile: getConsoleFn("profile"), profileEnd: getConsoleFn("profileEnd"), count: getConsoleFn("count"), clear: getConsoleFn("clear"), time: getConsoleFn("time"), timeEnd: getConsoleFn("timeEnd"), timeStamp: getConsoleFn("timeStamp"), table: getConsoleFn("table"), error: getConsoleFn("error"), memory: getConsoleFn("memory"), markTimeline: getConsoleFn("markTimeline"), timeline: getConsoleFn("timeline"), timelineEnd: getConsoleFn("timelineEnd") }; function getConsoleFn(name) { return function actionConsole() { if (typeof (orgConsole) !== "object") return; if (typeof (orgConsole[name]) !== "function") return;//判断原始console对象中是否含有此方法，若没有则直接返回 return orgConsole[name].apply(orgConsole, Array.prototype.slice.call(arguments));//调用原始函数 }; } }(window._console));

CV300EAPI
type: item
date: 2018-09-30T16:03:30+08:00
description: using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Helper { public class CV300EHelper { #region 指纹特征提取函数接口 /// /// 版本信息获取 /// 函数原型：int __stdcall FP_GetVersion(unsigned char code[4]) /// /// unsigned char code[4] 版本信息格式为XXYY，XX为开发者代码，YY为版本号。如“1201” 则code的填写方式为：，code[0]=‘1’ code[1]=，‘2’ code[3]=，‘0’ code[4]=,‘1’。输出参数。 /// <returns>调用成功，返回1；否则返回错误代码，错误代码值应符合B.4的要求。输出参数。</returns> [DllImport("ID_Fpr.dll", EntryPoint = "FP_GetVersion", CharSet = CharSet.Auto, SetLastError = false)] public static extern int FP_GetVersion(System.IntPtr code); /// /// 初始化操作 /// 函数原型：int __stdcall FP_Begin() /// /// <returns>调用成功返回 1。否则返回错误代码，调用 LIVESCAN_GetErrInfo 函数获取错误信息。错误代码值符合 B.4 的要求。</returns> [DllImport("ID_Fpr.dll", EntryPoint = "FP_Begin", CharSet = CharSet.Auto, SetLastError = false)] public static extern int FP_Begin(); /// /// 指纹图像特征提取 /// 函数原型：int __stdcall FP_FeatureExtract(unsigned char cScannerType,unsigned char cFingerCode,unsigned char * pFingerImgBuf,unsigned char * pFeatureData) /// /// unsigned char cScannerType 指纹采集器代码。输入参数。 /// unsigned char cFingerCode 指位代码。输入参数。 /// unsigned char * pFingerImgBuf 指纹图像数据指针，指纹图像为RAW格式。输入参数。 /// unsigned char * pFeatureData 指纹特征数据指针，存储生成的指纹特征数据，由调用者分配内存空间，输出参数。 /// <returns>调用成功，返回1；否则返回错误代码，错误代码值应符合B.4的要求</returns> [DllImport("ID_Fpr.dll", EntryPoint = "FP_FeatureExtract", CharSet = CharSet.Auto, SetLastError = false)] public static extern int FP_FeatureExtract(byte cScannerType, byte cFingerCode, System.IntPtr pFingerImgBuf, System.IntPtr pFeatureData); /// /// 指纹图像数据与指纹特征数据比对 /// 函数原型：int __stdcall FP_FeatureMatch(unsigned char * pFeatureData1,unsigned char* pFeatureData2,float * pfSimilarity) /// 对两个指纹特征数据进行比对，得到相似度值 /// /// unsigned char * pFeatureData1 指纹特征数据指针1。输入参数。 /// unsigned char * pFeatureData2 指纹特征数据指针2。输入参数。 /// float * pfSimilarity 相似度，取值范围为0…

ET99API
type: item
date: 2018-09-30T15:49:00+08:00
description: using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace API { public static class ET99_API { #region 常量 /// /// 函数执行成功 /// public const int ET_SUCCESS = 0x00; /// /// 访问被拒绝，权限不够 /// public const int ET_ACCESS_DENY = 0x01; /// /// 通讯错误，没有打开设备 /// public const int ET_COMMUNICATIONS_ERROR = 0x02; /// /// 无效的参数，参数出错 /// public const int ET_INVALID_PARAMETER = 0x03; /// /// 没有设置 PID /// public const int ET_NOT_SET_PID = 0x04; /// /// 打开指定的设备失败 /// public const int ET_UNIT_NOT_FOUND = 0x05; /// /// 硬件错误 /// public const int ET_HARD_ERROR = 0x06; /// /// 未知错误 /// public const int ET_UNKNOWN_ERROR = 0x07; /// /// 验证 PIN码掩码 /// public const int ET_PIN_ERR_MASK = 0x0F; /// /// 验证 PIN码,设备被锁定 /// public const int ET_PIN_ERR_LOCKED = 0xF0; /// /// 验证 PIN码错误且永远不锁死 /// public const int ET_PIN_ERR_MAX = 0xFF; /// /// 表示验证普通用户 pin /// public const int ET_VERIFY_USERPIN = 0; /// /// 表示验证超级用户 pin /// public const int ET_VERIFY_SOPIN = 1; /// /// 表示数据区可读写 /// public const int ET_USER_WRITE_READ = 0; /// /// 表示数据区只允许读 /// public const int ET_USER_READ_ONLY = 1; /// /// 常量 PID,默认的产品PID /// public const string CONST_PID = "ffffffff"; #endregion /// /// 根据错误码显示错误提示内容 /// /// public static string ShowResultText(uint result) { switch (result) { case (ET_SUCCESS): { return "操作成功！"; } case (ET_ACCESS_DENY): { return "访问被拒绝，权限不够！"; } case (ET_COMMUNICATIONS_ERROR): { return "通讯错误，没有打开设备 ！"; } case (ET_INVALID_PARAMETER): { return "无效的参数，参数出错 ！"; } case (ET_NOT_SET_PID): { return "没有设置 PID ！"; } case (ET_UNIT_NOT_FOUND): { return "打开指定的设备失败！"; } case (ET_HARD_ERROR): { return "硬件错误！"; } case (ET_UNKNOWN_ERROR): { return "未知错误！"; } case (ET_PIN_ERR_MAX): { return "PIN码错误！请核实。"; } case (ET_PIN_ERR_LOCKED): { return "PIN码错误！设备已经被锁死。"; } } //输出剩余PIN验证次数 if (result > ET_PIN_ERR_LOCKED && result < ET_PIN_ERR_MAX) { return "PIN码验证错误！剩余重试次数：" + (result - ET_PIN_ERR_LOCKED).ToString(); } return "未知代码！"; } /// /// 查找计算机上指定 pid 的 ET99 个数。 /// /// […

ViKeyAPI
type: item
date: 2018-09-30T15:49:00+08:00
description: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Helper { public class ViKeyAPI { public const string DefaultUserPassword = "11111111"; public const string DefaultAdminPassword = "00000000"; // 错误代码 public const long VIKEY_SUCCESS = 0x00000000; //成功 public const long VIKEY_ERROR_NO_VIKEY = 0x80000001; //没有找到ViKey加密锁 public const long VIKEY_ERROR_INVALID_PASSWORD = 0x80000002; //密码错误 public const long VIKEY_ERROR_NEED_FIND = 0x80000003; //请先查找加密锁 public const long VIKEY_ERROR_INVALID_INDEX = 0x80000004; //无效的句柄 public const long VIKEY_ERROR_INVALID_VALUE = 0x80000005; //数值错误 public const long VIKEY_ERROR_INVALID_KEY = 0x80000006; //秘钥无效 public const long VIKEY_ERROR_GET_VALUE = 0x80000007; //读取信息错误 public const long VIKEY_ERROR_SET_VALUE = 0x80000008; //设置信息错误 public const long VIKEY_ERROR_NO_CHANCE = 0x80000009; //没有机会 public const long VIKEY_ERROR_NO_TAUTHORITY = 0x8000000A; //权限不足 public const long VIKEY_ERROR_INVALID_ADDR_OR_SIZE = 0x8000000B; //地址或长度错误 public const long VIKEY_ERROR_RANDOM = 0x8000000C; //获取随机数错误 public const long VIKEY_ERROR_SEED = 0x8000000D; //获取种子错误 public const long VIKEY_ERROR_CONNECTION = 0x8000000E; //通信错误 public const long VIKEY_ERROR_CALCULATE = 0x8000000F; //算法或计算错误 public const long VIKEY_ERROR_MODULE = 0x80000010; //计数器错误 public const long VIKEY_ERROR_GENERATE_NEW_PASSWORD = 0x80000011; //产生密码错误 public const long VIKEY_ERROR_ENCRYPT_FAILED = 0x80000012; //加密数据错误 public const long VIKEY_ERROR_DECRYPT_FAILED = 0x80000013; //解密数据错误 public const long VIKEY_ERROR_ALREADY_LOCKED = 0x80000014; //ViKey加密锁已经被锁定 public const long VIKEY_ERROR_UNKNOWN_COMMAND = 0x80000015; //无效的命令 public const long VIKEY_ERROR_UNKNOWN_ERROR = 0xFFFFFFFF; //未知错误 //ViKey加密狗类型 VikeyGetType返回值代表的类型 public const uint ViKeyAPP = 0; //实用型加密狗ViKeyAPP public const uint ViKeySTD = 1; //标准型加密狗ViKeySTD public const uint ViKeyNET = 2; //网络型加密狗ViKeyNET public con…

EmailHelper
type: item
date: 2018-09-30T15:46:36+08:00
description: EmailHelperusing System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Net; using System.Net.Mail; using System.Text; namespace Helper { /// /// Author : yenange /// Date : 2014-02-26 /// Description : 邮件发送辅助类 /// public class EmailHelper { #region [ 属性(发送Email相关) ] private string _SmtpHost = string.Empty; private int _SmtpPort = -1; private string _FromEmailAddress = string.Empty; private string _FormEmailPassword = string.Empty; /// /// smtp 服务器 /// public string SmtpHost { get { if (string.IsNullOrEmpty(_SmtpHost)) { _SmtpHost = ConfigurationManager.AppSettings["SmtpHost"]; } return _SmtpHost; } } /// /// smtp 服务器端口 默认为25 /// public int SmtpPort { get { if (_SmtpPort == -1) { if (!int.TryParse(ConfigurationManager.AppSettings["SmtpPort"], out _SmtpPort)) { _SmtpPort = 25; } } return _SmtpPort; } } /// /// 发送者 Eamil 地址 /// public string FromEmailAddress { get { if (string.IsNullOrEmpty(_FromEmailAddress)) { _FromEmailAddress = ConfigurationManager.AppSettings["FromEmailAddress"]; } return _FromEmailAddress; } } /// /// 发送者 Eamil 密码 /// public string FormEmailPassword { get { if (string.IsNullOrEmpty(_FormEmailPassword)) { _FormEmailPassword = ConfigurationManager.AppSettings["FormEmailPassword"]; } return _FormEmailPassword; } } #endregion #region [ 属性(邮件相关) ] /// /// 收件人 Email 列表，多个邮件地址之间用 半角逗号 分开 /// public string ToList { get; set; } /// /// 邮件的抄送者，支持群发，多个邮件地址之间用 半角逗号 分开 /// public string CCList { get; set; } /// /// 邮件的密送者，支持群发，多个邮件地址之间用 半角逗号 分开 /// public string BccList { get; set; } /// /// 邮件标题 /// public string Subject { get; set; } /// /// 邮件正文 /// public string Body { get; set; } private bool _IsBodyHtml = true; /// /// 邮件正文是否为Html格式 /// public bool IsBodyHtml { get { return _IsBodyHtml; } set { _IsBodyHtml = value; } } /// /// 附件列表 /// public List<Attachment> AttachmentList { get; set; } #endregion #region [ 构造函数 ] /// /// 构造函数 (body默认为html格式) /// /// 收件人列表 /// 邮件标题 /// 邮件正文 public EmailHelper(string toLis…

FTPHelper
type: item
date: 2018-09-30T15:45:57+08:00
description: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; namespace Helper { public class FTPHelper { /// /// FTP请求对象 /// FtpWebRequest request = null; /// /// FTP响应对象 /// FtpWebResponse response = null; /// /// FTP服务器地址 /// public string ftpURI { get; private set; } /// /// FTP服务器IP /// public string ftpServerIP { get; private set; } /// /// FTP服务器默认目录 /// public string ftpRemotePath { get; private set; } /// /// FTP服务器登录用户名 /// public string ftpUserID { get; private set; } /// /// FTP服务器登录密码 /// public string ftpPassword { get; private set; } /// /// 初始化 /// /// FTP连接地址 /// 指定FTP连接成功后的当前目录, 如果不指定即默认为根目录 /// 用户名 /// 密码 public FTPHelper(string ftpServerIP, string ftpRemotePath, string ftpUserID, string ftpPassword) { this.ftpServerIP = ftpServerIP; this.ftpRemotePath = ftpRemotePath; this.ftpUserID = ftpUserID; this.ftpPassword = ftpPassword; this.ftpURI = "ftp://" + ftpServerIP + "/" + ftpRemotePath + "/"; } ~FTPHelper() { if (response != null) { response.Close(); response = null; } if (request != null) { request.Abort(); request = null; } } /// /// 建立FTP链接,返回响应对象 /// /// FTP地址 /// 操作命令 /// <returns></returns> private FtpWebResponse Open(Uri uri, string ftpMethod) { request = (FtpWebRequest)FtpWebRequest.Create(uri); request.Method = ftpMethod; request.UseBinary = true; request.KeepAlive = false; request.Credentials = new NetworkCredential(this.ftpUserID, this.ftpPassword); return (FtpWebResponse)request.GetResponse(); } /// /// 建立FTP链接,返回请求对象 /// /// FTP地址 /// 操作命令 private FtpWebRequest OpenRequest(Uri uri, string ftpMethod) { request = (FtpWebRequest)WebRequest.Create(uri); request.Method = ftpMethod; request.UseBinary = true; request.KeepAlive = false; request.Credentials = new NetworkCredential(this.ftpUserID, this.ftpPassword); return request; } /// /// 验证登录用户是否合法 /// /// ftp路径 /// ftp用户名 /// ftp密码 /// <returns></returns> public bool CheckFtp() { bool res = false; try { request = (FtpWebRequest)Ftp…

SqliteHelper
type: item
date: 2018-09-30T15:45:28+08:00
description: packageInstall-Package System.Data.SQLite.EF6Config<connectionStrings> <add name="DB_HES" connectionString="Data Source=|DataDirectory|App_Data\DB_HES.db;Version=3;UseUnicode=true;characterEncoding=UTF-8;" providerName="System.Data.SQLite.EF6" /> </connectionStrings>SqliteHelperusing System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SQLite; using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Xml; namespace HES.AddAdmin { /// /// 对SQLite操作的类 /// 引用：System.Data.SQLite.dll【版本：3.6.23.1（原始文件名：SQlite3.DLL）】 /// public class SQLiteHelper { /// /// 所有成员函数都是静态的，构造函数定义为私有 /// private SQLiteHelper() { } /// /// 连接字符串 /// public static string ConnectionString {//"Data Source=Test.db3;Pooling=true;FailIfMissing=false"; get { ////(AppSettings节点下的"SQLiteConnectionString") string text = ConfigurationManager.ConnectionStrings["SQLiteConnectionString"].ConnectionString; //string str2 = ConfigurationManager.AppSettings["IsEncrypt"]; //if (str2 == "true") //{ // text = DesEncrypt.Decrypt(text); //} return text; } } private static SQLiteConnection _Conn = null; /// /// 连接对象 /// public static SQLiteConnection Conn { get { if (_Conn == null) _Conn = new SQLiteConnection(ConnectionString); return SQLiteHelper._Conn; } set { SQLiteHelper._Conn = value; } } #region CreateCommand(commandText,SQLiteParameter[]) /// /// 创建命令 /// /// 连接 /// 语句 /// 语句参数. /// <returns>SQLite Command</returns> public static SQLiteCommand CreateCommand(string commandText, params SQLiteParameter[] commandParameters) { SQLiteCommand cmd = new SQLiteCommand(commandText, Conn); if (commandParameters.Length > 0) { foreach (SQLiteParameter parm in commandParameters) cmd.Parameters.Add(parm); } return cmd; } #endregion #region CreateParameter(parameterName,parameterType,parameterValue) /// /// 创建参数 /// /// 参数名 /// 参数类型 /// 参数值 /// <returns>返回创建的参数</returns> public static SQLiteParamet…