私の vb.net プログラムは、レジストリ ファイルを作成/開く/編集します。開発後、プログラムを別のコンピューターで使用すると、エラーが返されます。
レジストリ ファイルをコンピュータにインポートすると、プログラムは正常に実行されるので、エラーはレジストリ ファイルの作成に関係していると思われます。
これは、プログラムがレジストリ ファイルを作成する方法です。
Function createRegistrykey()
Dim openKey As RegistryKey
openKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\RobinsonsRetailGroup\LogSettings", True)
'[SPECIFICATION]
If (openKey.GetValue("STORENAME") = Nothing) Then
openKey.SetValue("STORENAME", "RRR", RegistryValueKind.String)
End If
If (openKey.GetValue("STORENUMBER") = Nothing) Then
openKey.SetValue("STORENUMBER", "000", RegistryValueKind.String)
End If
'[DEFAULT]
If (openKey.GetValue("UTILFLR") = Nothing) Then
openKey.SetValue("UTILFLR", "C:\Util", RegistryValueKind.String)
End If
If (openKey.GetValue("GRSFLR") = Nothing) Then
openKey.SetValue("GRSFLR", "D:\DC\Instances\", RegistryValueKind.String)
End If
If (openKey.GetValue("EXPORTFLR") = Nothing) Then
openKey.SetValue("EXPORTFLR", "C:\Export", RegistryValueKind.String)
End If
If (openKey.GetValue("OFFICEIMPFLR") = Nothing) Then
openKey.SetValue("OFFICEIMPFLR", "C:\Program Files\", RegistryValueKind.String)
End If
If (openKey.GetValue("PCMSTBAKFLR") = Nothing) Then
openKey.SetValue("PCMSTBAKFLR", "C:\BAK", RegistryValueKind.String)
End If
If (openKey.GetValue("DBASEBAKFLR") = Nothing) Then
openKey.SetValue("DBASEBAKFLR", "D:\Backup\Store", RegistryValueKind.String)
End If
If (openKey.GetValue("INTBACKUPFLR") = Nothing) Then
openKey.SetValue("INTBACKUPFLR", "D:\BACKUP", RegistryValueKind.String)
End If
If (openKey.GetValue("EXTBACKUPFLR") = Nothing) Then
openKey.SetValue("EXTBACKUPFLR", "none", RegistryValueKind.String)
End If
'[POS]
If (openKey.GetValue("POSUSER") = Nothing) Then
openKey.SetValue("POSUSER", "Administrator", RegistryValueKind.String)
End If
If (openKey.GetValue("POSPASS") = Nothing) Then
openKey.SetValue("POSPASS", hashEncoding("isd"), RegistryValueKind.String)
End If
If (openKey.GetValue("LOGVIEWERPASS") = Nothing) Then
openKey.SetValue("LOGVIEWERPASS", hashEncoding("BBOEY"), RegistryValueKind.String)
End If
openKey.Close()
Return vbNull
End Function
このエラーが発生する理由を知っている人はいますか?