Skip to content

Instantly share code, notes, and snippets.

@lxfly2000
lxfly2000 / wshtest.cpp
Created July 25, 2022 09:24
VC++调用WSH(COM组件)的方法
#include <Windows.h>
#undef GetFreeSpace
//若不在行尾加no_namespace则需要在引用接口时使用IWshRuntimeLibrary命名空间
#import "C:\Windows\System32\wshom.ocx"
#include "Debug\wshom.tlh"
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")//使用视觉样式
int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int)
{
SetProcessDPIAware();
@lxfly2000
lxfly2000 / eoscheck.js
Created July 25, 2022 03:15
检查微软操作系统的支持状态
//注意文本编码应为ANSI
var enddates=[
{os:"Windows XP",date:"2014/4/8"},
{os:"Windows Vista",date:"2017/4/11"},
{os:"Windows 7",date:"2023/1/14"},
{os:"Windows 8.1",date:"2023/1/10"},
{os:"Windows 8",date:"2016/1/12"},
{os:"Windows 10",date:"2025/10/14"}];
var osname=new Enumerator(GetObject("winmgmts:").ExecQuery("SELECT * FROM Win32_OperatingSystem")).item().Caption;
for(var i=0;i<enddates.length;i++){
#include <Windows.h>
#include <CommCtrl.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <strsafe.h>
struct ENTRY
{
PGraphics imgNoise[],imgCaptcha,imgBlended;
int x1=0,x2=0,recorded=0;
void setup(){
size(640,400);
imgNoise=new PGraphics[2];
for(int i=0;i<imgNoise.length;i++){
imgNoise[i]=createGraphics(width,height);
imgNoise[i].beginDraw();
for(int y=0;y<height;y++){
@lxfly2000
lxfly2000 / booru-sites.md
Last active May 1, 2025 01:17
Booru sites.
@echo off
echo CPU:
wmic cpu get Manufacturer
wmic cpu get Name
wmic cpu get ProcessorID
echo Hard Disk:
wmic diskdrive get serialnumber
echo BIOS:
wmic baseboard get serialnumber
echo MAC Address:
@lxfly2000
lxfly2000 / filehash.bat
Last active September 18, 2023 06:58
使用时把脚本放到SendTo文件夹
@echo off
if "%~1"=="" (
echo 未指定文件。
goto :end
)
for %%i in (%*) do call :calchash %%i
:end
if "%~0"=="%~dpnx0" pause
goto :eof
:calchash
@lxfly2000
lxfly2000 / rmdup.sh
Last active September 18, 2020 04:44
删除重复的文件
#!/system/bin/sh
if (($# < 1)) then
echo "未指定路径。"
exit 1
fi
#通过参数指定一个目录
path=$1 #定义时变量不用加$,而引用时则需要加$,若要避免歧义则需要写成${path}形式,另外=左右不能有空格
@lxfly2000
lxfly2000 / LuaBot.cpp
Last active August 24, 2020 09:33
Lua机器人示例
#include <iostream>
#include <string>
#include "lua.hpp"
#pragma comment(lib,"lua54.lib")
#define PushFunctionToLua(lua_state,lua_cfunction) lua_register(lua_state,_CRT_STRINGIZE(lua_cfunction),lua_cfunction)
#define LUA_CFUNCTION(function_name,lua_state) int function_name(lua_State* lua_state)
#include<Windows.h>
#include<vector>
#include<algorithm>
struct SpectrumPoint
{
int p;
union{
struct
{