Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 在Regwrite行中插入变量值_Vb.net_Variables_Registry - Fatal编程技术网

Vb.net 在Regwrite行中插入变量值

Vb.net 在Regwrite行中插入变量值,vb.net,variables,registry,Vb.net,Variables,Registry,嗨,我有一个名为VAR1的变量,我需要在我的regkey中插入变量值,其中显示140 我该怎么做 Private Sub OKAY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKAY.Click Dim wshshell wshshell = CreateObject("WScript.Shell") wshshell.RegWrite("HKLM\SOF

嗨,我有一个名为VAR1的变量,我需要在我的regkey中插入变量值,其中显示140 我该怎么做

    Private Sub OKAY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKAY.Click

    Dim wshshell

    wshshell = CreateObject("WScript.Shell")
    wshshell.RegWrite("HKLM\SOFTWARE\Microsoft\windows\CurrentVersion\policies\Explorer\NoDrives", 140, "REG_DWORD")

End Sub

当您可以使用框架时,请不要使用wshshell,请看一看已经在web上的许多示例中的一个。或者看看众多重复问题中的一个。

不错,但这种方法对我最有效,除非因为它无疑是我问题的根本原因。。。