retrieve a string from the registry


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: retrieve a string from the registry

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    retrieve a string from the registry

    [Originally posted by ramani]

    hello everyone
    i want to retrieve a string from the registry.
    can anybody help

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center