Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,261 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,181 people online right now. Registration is fast and FREE... Join Now!




Project Help on How to do this:

 
Reply to this topicStart new topic

Project Help on How to do this:, I need help on figuring out how to do this kind of project

kalabidong
13 Oct, 2008 - 07:59 AM
Post #1

New D.I.C Head
*

Joined: 23 Aug, 2008
Posts: 7

Hi everybody,

I'm having trouble on how to improve my project. I'm making an application that hides a folder visually. I already have the code for my main program but my instructor wants a twist in it. He wants me to add a feature on it that will show if the application was first loaded. Here's the twist:

1.) Upon initialization, a form will pop-up and will tell me that it's the first time it was loaded and will ask for a password for it (the form) to be used on the next loading.

2.) After the pop-up form, it will load the main program and performs its tasks. Then the application terminates.

3.) If ever the application be run again, a password form will show instead of the pop-up form from before. Then if the password matches on the pop-up form, the main application will load.

I'm using this code on my password form:

CODE
Imports System.IO
Public Class password
    Dim Pass As String = Environment.CurrentDirectory & "\" & "Password.txt"


    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Static Count As Int16 = 0

        Dim fileContents As String
        fileContents = My.Computer.FileSystem.ReadAllText(PFile)

        If fileContents.Trim = TextBox1.Text.Trim Then
            Me.DialogResult = System.Windows.Forms.DialogResult.OK
            'I remove the long performance operation of the program
            MsgBox("Stealth folder is now visible", MsgBoxStyle.Information)
            Application.Exit()
        Else
            MsgBox("Wrong Password")
            Count += 1
            If Count >= 3 Then
                End
            End If
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub
End Class


Please help me in satisfying that "twist" that was given by my teacher. Thank you very much...
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Project Help On How To Do This:
13 Oct, 2008 - 08:13 AM
Post #2

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 799



Thanked: 51 times
Dream Kudos: 2175
My Contributions
Use the Settings in Projects Properties, to setup a setting called AlreadyRun (a boolean).
Then use something like this in app's load event.
vb

If My.Settings.AlreadyRun Then
' The App has already been run.
Else
' App's first run

My.Settings.AlreadyRun = True
My.Settings.Save()



End If

User is online!Profile CardPM
+Quote Post

kalabidong
RE: Project Help On How To Do This:
13 Oct, 2008 - 08:46 AM
Post #3

New D.I.C Head
*

Joined: 23 Aug, 2008
Posts: 7

QUOTE(AdamSpeight2008 @ 13 Oct, 2008 - 09:13 AM) *

Use the Settings in Projects Properties, to setup a setting called AlreadyRun (a boolean).
Then use something like this in app's load event.
vb

If My.Settings.AlreadyRun Then
' The App has already been run.
Else
' App's first run

My.Settings.AlreadyRun = True
My.Settings.Save()



End If



cool... thank you very much for your help.. its working.. bananaman.gif thumbs-up.gif i'm soooooo noob.... biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 04:36AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month