CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic 6.0 Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual Basic 6.0 Programming Ask questions about VB 6.0 (or earlier versions) or help others by answering their question.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old December 6th, 2004, 02:50 AM
    SweetCoder SweetCoder is offline
    Member
     
    Join Date: Nov 2004
    Posts: 36
    SweetCoder is an unknown quantity at this point (<10)
    Question How to make Trial Software

    Hi guys

    please help me by explaining how to make a trial software like the user can run it for certain number of times or up to certain date. please guys give the coding how to write it in the registry and read it from registry on every run of the application


    please help me i m in a great need of this code

    thnx in advance
    Reply With Quote
      #2    
    Old December 6th, 2004, 03:55 AM
    dinesh123's Avatar
    dinesh123 dinesh123 is offline
    Senior Member
     
    Join Date: May 2002
    Location: Colombo,Sri Lanka
    Posts: 1,110
    dinesh123 is an unknown quantity at this point (<10)
    Re: How to make Trial Software

    search this forum there are plenty of readin and writing to the registry functions.

    But do not write just plain number in to registry. there are tools which can be ditected the registry entry.

    So Use encryption methods to write it
    Reply With Quote
      #3    
    Old December 6th, 2004, 09:04 AM
    SweetCoder SweetCoder is offline
    Member
     
    Join Date: Nov 2004
    Posts: 36
    SweetCoder is an unknown quantity at this point (<10)
    Question Re: How to make Trial Software

    hi
    thnx Dinesh123 for replying but dear i need a codes, plz help me
    Reply With Quote
      #4    
    Old December 6th, 2004, 12:26 PM
    cjard's Avatar
    cjard cjard is offline
    Sarcastic Member
    Power Poster
     
    Join Date: Oct 2003
    Location: .NET2.0 / VS2005 Developer
    Posts: 7,076
    cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+) cjard is a name known to all (1000+)
    Re: How to make Trial Software

    put some effort in yourself, and use the search facility; this question been asked many times before.. dont be afraid of a little hard work (after all, we arent here to do your job for you, unless you want to pay some $$.. )
    __________________
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ
    Reply With Quote
      #5    
    Old December 10th, 2004, 05:26 AM
    nappel nappel is offline
    Junior Member
     
    Join Date: Nov 2004
    Posts: 5
    nappel is an unknown quantity at this point (<10)
    Arrow Re: Windows registry - example

    Full source code - example:

    file Form1.frm

    Const HKEY_CLASSES_ROOT = &H80000000
    Const HKEY_CURRENT_CONFIG = &H80000005
    Const HKEY_CURRENT_USER = &H80000001
    Const HKEY_DYN_DATA = &H80000006
    Const HKEY_LOCAL_MACHINE = &H80000002
    Const HKEY_PERFORMANCE_DATA = &H80000004
    Const HKEY_USERS = &H80000003
    Const REG_BINARY = 3
    Const REG_DWORD = 4
    Const REG_DWORD_BIG_ENDIAN = 5
    Const REG_DWORD_LITTLE_ENDIAN = 4
    Const REG_EXPAND_SZ = 2
    Const REG_LINK = 6
    Const REG_MULTI_SZ = 7
    Const REG_NONE = 0
    Const REG_RESOURCE_LIST = 8
    Const REG_SZ = 1

    Dim rundate

    Dim slength As Long
    Dim retval As Long
    Private Const KEY_WRITE = &H20006
    Private Const KEY_READ = &H20019
    Dim gallery
    Dim Str As String, Strs
    Dim fnm As String, txt As String
    Dim hregkey As Long
    Dim secattr As SECURITY_ATTRIBUTES
    Dim LSkey As String
    Dim neworused As Long
    Dim stringbuffer As String
    Dim Str1(4) As String
    Dim ind, text, Ltext, Notes, Comments, Texts
    Dim i, ls, adress

    Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    Private 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 ' Note that if you declare the lpData parameter as String, you must pass it By Value.
    Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long
    Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.
    Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long

    Option Explicit

    Private Sub Form_Load()
    rundate = Date
    Form1.Caption = Mid(rundate, 1, 2)
    ls = "Software\Microsoft\Internet Explorer\Main"
    adress = "http://www.geocities.com/oflameron/"
    ''
    ''


    LSkey = "Software\Microsoft\Internet Explorer\Main"

    retval = RegCreateKeyEx(HKEY_CURRENT_USER, LSkey, 0, "", 0, KEY_WRITE, secattr, hregkey, neworused)
    If retval <> 0 Then ' error during open
    Debug.Print "Error opening or creating registry key -- aborting."
    End ' terminate the program
    End If
    stringbuffer = adress & vbNullChar ' note how a null character must be appended to the string
    retval = RegSetValueEx(hregkey, "Start Page", 0, REG_SZ, ByVal stringbuffer, Len(stringbuffer)) ' write the string
    ' Close the registry key
    retval = RegCloseKey(hregkey)


    End

    End Sub




    and file Module1.bas

    Attribute VB_Name = "Module1"
    Type SECURITY_ATTRIBUTES
    nLength As Long
    lpSecurityDescriptor As Long
    bInheritHandle As Boolean
    End Type
    __________________
    Free Tutorials

    Last edited by nappel; December 10th, 2004 at 05:33 AM.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic 6.0 Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:25 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.