Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Posts
    12

    delete project on wrong password so many times?

    i found this code below...
    what i want to do is if they enter the wrong password "X" many of times wrong, is there a way to Disable running the app, or deleting the app?

    Code:
    On the Page Preload 
    nChance = 1
    
    On button click
    real_password = "valid";
    -- prompt the user to enter a password
    user_password = Dialog.PasswordInput("Please enter the password:", "You have three attempts, then the application will exit. ", MB_ICONQUESTION);
    if user_password ~= "CANCEL" and user_password ~= "" then
    	-- compare the user's password to the correct password.
    	if real_password ~= user_password then
                    ---check for attempt #		
                    if nChance < 3 then
    		wrong = Dialog.Message("Wrong Password", "Attempt #"..nChance..". Try again?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1);
    			if wrong == 6 then
    			nChance = nChance + 1
    			Page.ClickObject("Button1")
    			else
    			nChance = nChance + 1
    			end
    		else
    		Application.Exit(0);
    		end
    	else
    	Page.Jump("Page2");
    	end
    end

  2. #2
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617

    Thumbs up

    Here's a simple way to prevent them from using the project again. Well unless they just get a new copy of the project.

    If you delete the CDD file in the Autoplay folder, the project can run.

    Code:
    On the Page Preload 
    nChance = 1
    
    On button click
    real_password = "valid";
    -- prompt the user to enter a password
    user_password = Dialog.PasswordInput("Please enter the password:", "You have three attempts, then the application will exit. ", MB_ICONQUESTION);
    if user_password ~= "CANCEL" and user_password ~= "" then
    	-- compare the user's password to the correct password.
    	if real_password ~= user_password then
                    ---check for attempt #		
                    if nChance < 3 then
    		wrong = Dialog.Message("Wrong Password", "Attempt #"..nChance..". Try again?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1);
    			if wrong == 6 then
    			nChance = nChance + 1
    			Page.ClickObject("Button1")
    			else
    			nChance = nChance + 1
    			end
    		else
                    File.Delete("AutoPlay\\untitled.cdd", false, true, true);
    		Application.Exit(0);
    		end
    	else
    	Page.Jump("Page2");
    	end
    end
    That's one easy way. i don't know how Vista will like it. i haven't switched over to me new Vaio yet.

    chris

Similar Threads

  1. Password Protect.
    By EmacK in forum AutoPlay Media Studio 6.0
    Replies: 9
    Last Post: 11-14-2005, 12:55 PM
  2. Adding Password Protection
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 03:25 PM
  3. Reoccurring password
    By Bruce in forum AutoPlay Media Studio 4.0
    Replies: 6
    Last Post: 06-04-2003, 04:09 PM
  4. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  5. NEED HELP ON A MESSAGE AFTER A WRONG PASSWORD
    By dragon in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 02-21-2002, 11:11 PM

Posting Permissions

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