Created
May 7, 2018 08:12
-
-
Save FGFW/a555aa36849e2ed86897fe85c42fae73 to your computer and use it in GitHub Desktop.
nim读写注册表的小例子 ref: https://qiita.com/codegay/items/800c0e67c1a0096c0876
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import registry | |
const path = r"SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" | |
const key = "srvcomment" | |
proc getsrvcomment():string {.discardable.} = | |
getUnicodeValue(path, key, HKEY_LOCAL_MACHINE) | |
echo getsrvcomment() | |
proc setsrvcomment(comment: string) {.discardable.} = | |
setUnicodeValue(path, key, val = comment, HKEY_LOCAL_MACHINE) | |
setsrvcomment("呆瓜小贼 给我上来") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment