Google
 
Web itpro-blogger.blogspot.com
月曜日, 1月 23, 2006

[VB2005]レジストリ関連

■Windowsレジストリに、アプリケーションの初期ファイルを保存または作成する。
・VB6.0 or VB.NET or VB2005
SaveSetting関数
http://www.microsoft.com/japan/msdn/library/default.asp?url=/japan/msdn/library/ja/vblr7/html/vastmSaveSetting.asp
SaveSetting("AppName", "Section", "Key", "Setting")

・VB.NET
http://www.microsoft.com/japan/msdn/vbasic/migration/tips/registry.aspx

・VB2005
Dim KeyName As String
KeyName = "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\AppName\Section"
My.Computer.Registry.SetValue(KeyName, "Key", "Setting")

■Windowsレジストリのアプリケーションの初期設定ファイルから、キー設定値を返す。
・VB6.0 or VB.NET or VB2005
GetSetting関数
GetSetting("AppName", "Section", "Key", "Default")

・VB2005
Dim KeyName As String
KeyName = "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\AppName\Section"
My.Computer.Registry.GetValue(KeyName, "Key", "Default")

■Windowsレジストリのアプリケーションの初期設定ファイルから、セクションまたはキー設定を削除する。
・VB6.0 or VB.NET or VB2005
DeleteSetting関数
DeleteSetting("AppName")

・VB2005
Dim SubKey As Microsoft.Win32.RegistryKey
Dim KeyName As String = "Software\VB and VBA Program Settings"
SubKey = My.Computer.Registry.CurrentUser.OpenSubKey(KeyName, True)
SubKey.DeleteSubKeyTree("AppName")
SubKey.Close()






Comments: コメントを投稿

<< Home

This page is powered by Blogger. Isn't yours?