Archive for 十二月 2nd, 2018

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace HWL.LOCKDESKTOP
{
class Hook
{
//键盘Hook结构函数
[StructLayout(LayoutKind.Sequential)]
public class KeyBoardHookStruct
{
public int vkCode;
public int scanCode;
public int flags;
public int time;
public int dwExtraInfo;
}

//委托
public delegate int HookProc(int nCode, int wParam, IntPtr lParam);
static int hHook = 0;
public const int WH_KEYBOARD_LL = 13;
(more…)

using System;
using System.IO;
using System.Security.Cryptography;

namespace HWL.FileEncrypt
{
//异常处理类
public class CryptoHelpException : ApplicationException
{
public CryptoHelpException(string msg) : base(msg) { }
}

public class DESFileClass
{
private const ulong FC_TAG = 0xFC010203040506CF;
private const int BUFFER_SIZE = 128 * 1024;
//检验两个Byte数组是否相同,true-相等
private static bool CheckByteArrays(byte[] b1, byte[] b2)
{
if (b1.Length == b2.Length)
{
for (int i = 0; i < b1.Length; ++i)
{
if (b1[i] != b2[i])
return false; (more…)