乙個對計算機進行控制的類(c )

2021-06-16 00:38:29 字數 2094 閱讀 4920

[整理]乙個對計算機進行控制的類(c#)不斷更新中

整理了幾個實用的對計算機管理的c#**,放在乙個類中,方便使用

public static void poweroff()關機

public static void logoff()登出

public static void closemonitor(intptr handle)關閉顯示器

public static void openmonitor(intptr handle)開啟顯示器

public class mycontrol

[dllimport("kernel32.dll", exactspelling = true)]

private static extern intptr getcurrentprocess();

[dllimport("advapi32.dll", exactspelling = true, setlasterror = true)]

private static extern bool openprocesstoken(intptr h, int acc, ref intptr phtok);

[dllimport("advapi32.dll", setlasterror = true)]

private static extern bool lookupprivilegevalue(string host, string name, ref long pluid);

[dllimport("advapi32.dll", exactspelling = true, setlasterror = true)]

private static extern bool adjusttokenprivileges(intptr htok, bool disall, ref tokpriv1luid newst, int len, intptr prev, intptr relen);

[dllimport("user32.dll", exactspelling = true, setlasterror = true)]

private static extern bool exitwindow***(int doflag, int rea);

[dllimport("user32.dll")]

public static extern intptr sendmessage(intptr hwnd, uint msg, uint wparam, int lparam);

private const int se_privilege_enabled = 0x00000002 private const int token_query = 0x00000008 private const int token_adjust_privileges = 0x00000020 private const string se_shutdown_name = "seshutdownprivilege" private const int ewx_logoff = 0x00000000 private const int ewx_shutdown = 0x00000001 private const int ewx_reboot = 0x00000002 private const int ewx_force = 0x00000004 private const int ewx_poweroff = 0x00000008 private const int ewx_forceifhung = 0x00000010

private const uint wm_syscommand = 0x0112 private const uint sc_monitorpower = 0xf170 private static void doexitwin(int doflag)

public static void reboot()

public static void poweroff()

public static void logoff()

public static void closemonitor(intptr handle)

public static void openmonitor(intptr handle)

} 本文**

對計算機模擬人腦的乙個小想法

在 人工智慧的未來 一書中,是這樣描述人腦的計算過程的 分為抽象程度不同的六層,層內部有大量的神經突出相互聯絡,層與高抽象層有極多的聯絡,高層對下有柱形的聯絡。訊號會逐層向上抽象事物,同時上層的抽象會反饋刺激下層,補全不完整資訊。這個很像個多抽象層次 有層間反饋的全聯通帶權圖。輸入將是最底層的數個特...

乙個計算機小透明的心聲

高考結束後的報考,我信誓旦旦的報考了有關計算機的專業,儘管當時的我並不知道我未來將會面對乙個如何的困境,就像現在的我一樣無助。填寫志願的時候,我覺得計算機這個名字比物聯網,軟體,網路的名字都大氣,毋庸置疑的就填了這個。不順利的踏入了自己非期望中的學校,好歹是自己的第一專業不知道是不是應該慶幸。今年大...

C 控制遠端計算機的服務

使用wmi實現,前提 知道對方ip,有效的使用者名稱,密碼。public class servicecontrol else this.managementclass.scope managementscope 驗證是否能連線到遠端計算機 位址 使用者名稱 密碼 public static bool...