using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
public class aaa : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
LockWorkStation();
}
}
[DllImport("user32 ")]
public static extern bool LockWorkStation();
//锁屏按钮单击事件
private void button1_Click(object sender, EventArgs e)
{
LockWorkStation();
}
}
Dll下载:https://download.csdn.net/download/abcd5711664321/10577170
解压密码 www.zhaodll.com