当我尝试使用python键盘库来解锁我的windows桌面时。
keyboard.send('win+l')
它会在屏幕上打印l,但不会锁定计算机
后来我使用ctypes.windll.lockworkstation()来锁定我的计算机,但是当我想控制我的键盘来解锁我的计算机时,它不工作,那么我应该如何解决这个问题
下面是我现在的代码,我使用python36/win10
import ctypes,time,keyboard
dll = ctypes.WinDLL('user32.dll')
dll.LockWorkStation()
time.sleep(1)
keyboard.send('enter')
keyboard.send('1,2,3')
keyboard.send('enter')
发布于 2021-04-19 13:11:40
对于任何仍在寻找解决方案的人来说,都没有(在python中)
不幸的是,幸运的是,Windows阻止了密码/密码屏幕中的软件键盘输入,以防止自动脚本控制PC。通过编程解锁Windows的几种方法是,要么模拟物理键盘,要么使用低级语言,如C、C++或C#
https://stackoverflow.com/questions/46934937
复制相似问题