tryLenB(StrConv(SubKeyValue, vbFromUnicode))

解决方案 »

  1.   

    Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
    SubKeyValue = "CSCFlags=0" + vbNullChar + "MaxUses = 4294967295#" + vbNullChar + "Path=C:\" + vbNullChar + "Permissions = 0" + vbNullChar + "Re=" + vbNullChar + "Type=0" + vbNullChar + vbNullCharDim TempBytes() as ByteTempBytes=StrConv(SubKeyValue, vbFromUniCode)RegSetValueEx(hKey, "NewShare" , 0, REG_MULTI_SZ, TempBytes(0), LenB(TempBytes))VB操作注册表:
    http://www.sqreg.com/file/vb/reg_01.htm
    http://www.sqreg.com/file/vb/reg_02.htm
    http://www.sqreg.com/file/vb/reg_03.htm
    http://www.sqreg.com/file/vb/reg_04.htm
    http://www.sqreg.com/file/vb/reg_05.htm
    http://www.sqreg.com/file/vb/reg_06.htm
    http://www.sqreg.com/file/vb/reg_07.htm