Results 1 to 39 of 39

Thread: How do i make my program work for 5 times and then Expire

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Re: How do i make my program work for 5 times and then Expire

    Quote Originally Posted by GlueyMcGee
    I might have a simple idea : compress zxs and put a password to it.
    BTW i'd like to do the same thing to my program but i don't know how to make it count the days with a .txt file, may i ask how you did this? (Send me an e-mail at [email protected] with explanation/code plz)
    Sure man heres my code:


    Code:
    Imports System.IO
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        End Sub
    
        Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
            Dim SR As New StreamReader(Application.StartupPath & "\zxs.txt")
            Dim s As Integer = CInt(SR.ReadLine)
            s += 1
            If s <= 5 Then
                MsgBox("This is Try #" & s & " of 5.", MsgBoxStyle.Information)
                SR.Dispose()
                Dim SW As New StreamWriter(Application.StartupPath & "\zxs.txt", False)
                SW.WriteLine(s)
                SW.Close()
                SW.Dispose()
            Else
                MsgBox("Your trial has expired!", MsgBoxStyle.Exclamation)
                Application.Exit()
            End If
    
        End Sub
    End Class
    Just make sure you create the zxs.txt file in the debug folder so the program can read from it. GreEtz.
    Last edited by uaeXuae; Apr 5th, 2008 at 10:17 PM.
    Nothing Happens But first a dream "Carl Sandburg"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width