-
retrieve a string from the registry
[Originally posted by ramani]
hello everyone
i want to retrieve a string from the registry.
can anybody help
-
Re:retrieve a string from the registry
[Originally posted by sumit]
'just paste this in a class module & use it
Option Explicit
Private psAppName As String
Private psSetting As String
Private psKey As String
Private psDefault As String
Private psSection As String
Public Property Get AppName() As String
AppName = psAppName
End Property
Public Property Let AppName(ByVal NewValue As String)
psAppName = NewValue
End Property
Public Property Get Key() As String
ÿ ÿ Key = psKey
End Property
Public Property Let Key(ByVal NewValue As String)
ÿ ÿ psKey = NewValue
End Property
Public Property Get Setting() As String
If Len(psSection) > 0 And Len(psKey) > 0 And Len(psAppName) > 0 Then
ÿ ÿ psSetting = GetSetting(psAppName, psSection, psKey, psDefault)
ÿ ÿ Setting = psSetting
End If
End Property
Public Property Let Setting(ByVal NewValue As String)
If Len(psSection) > 0 And Len(psKey) > 0 And Len(psAppName) > 0 Then
ÿ ÿ psSetting = NewValue
ÿ ÿ SaveSetting psAppName, psSection, psKey, psSetting
ÿ ÿ
End If
End Property
Public Property Get Section() As String
Section = psSection
End Property
Public Property Let Section(ByVal NewValue As String)
psSection = NewValue
End Property
Public Property Get NamedSetting(Key As String) As String
If Len(psSection) > 0 And Len(psAppName) > 0 Then
ÿ ÿ psSetting = GetSetting(psAppName, psSection, Key, psDefault)
ÿ ÿ NamedSetting = psSetting
End If
End Property
Public Property Let NamedSetting(Key As String, ByVal NewValue As String)
If Len(psSection) > 0 And Len(psAppName) > 0 Then
ÿ ÿ SaveSetting psAppName, psSection, Key, NewValue
ÿ ÿ psSetting = NewValue
End If
ÿ ÿ
End Property
Public Property Get Default() As String
ÿ ÿ Default = psDefault
End Property
Public Property Let Default(ByVal NewValue As String)
ÿ ÿ psDefault = NewValue
End Property
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks