|
-
May 16th, 2008, 04:27 AM
#1
Thread Starter
Lively Member
First Run
Hi, hope you can help, i want to be able allow my program to be able to dfetect if it has been run before (so that if it hasnt it will load the setup form where i can fill in my details) and then if i run the program again it will run the regular form
PSUEDO
Run the proram --> Detects if it has been run before --> No, then load the setup form...
Run the proram --> Detects if it has been run before --> Yes, then load the logon form.
Thanks in advance
Stuart Jones
Network Manager
-
May 16th, 2008, 05:01 AM
#2
Re: First Run
You can do it in many ways.
With a value check on the registry.
With a file that has an i/o that will tell you if the program has been run.
Inside the program with application settings.
Getting a value from a database.
Registry or application settings seems better to me but you can do it in any way you like.
-
May 16th, 2008, 05:02 AM
#3
Fanatic Member
Re: First Run
have a look at you can also viiew it by dblclicking on project under the solution explorer window
-
May 16th, 2008, 05:10 AM
#4
Thread Starter
Lively Member
Re: First Run
Thanks for the replies.
I would like to do this through the registry if you know how this is done
Thanks in advance
Stuart Jones
Network Manager
-
May 16th, 2008, 05:24 AM
#5
-
May 16th, 2008, 05:27 AM
#6
Re: First Run
Using the application settings would be far better than using the registry.
-
May 16th, 2008, 06:24 AM
#7
Thread Starter
Lively Member
Re: First Run
Hi, Thanks for the reply
Can you please explain why that would be better from my point of view i see that a registry key will stivk until it is deleted, but i have never used the my.settings.
Please advise
Stuart Jones
Network Manager
-
May 16th, 2008, 06:28 AM
#8
Re: First Run
Well, the fact that the registry entry will stay until its deleted is not really an argument, as the same goes for pretty much anything.
The reason one shouldnt use the registry is that it:
- Clutters the registry.
- Requires the user to have the privileges to edit the registry. Vista, for example, will not like your application 
The application settings is defenitely the way to go. Alot simpler too.
-
May 16th, 2008, 06:35 AM
#9
Thread Starter
Lively Member
Re: First Run
Hi, well i rest my case do you know how to configure that i only thought the registry was a gd idea because i knew what i was doing and i am so unfamiliar with the my.setting.
Your help is appreciated
Stuart Jones
Network Manager
-
May 16th, 2008, 06:52 AM
#10
Fanatic Member
Re: First Run
The seetings reprensent a collection of information (an array). You can access different items as you would for any other collection.
vb Code:
if convert.toBoolean(my.Settings.item("HasBeenUsedBefore")) then 'your code end if
-
May 16th, 2008, 07:07 AM
#11
Re: First Run
As of a coinsidence, this question was asked just the other day. Check this thread, i've described how to add and use an application setting in there.
-
May 16th, 2008, 07:11 AM
#12
Fanatic Member
Re: First Run
Atheist, may I ask what version of VS are u using. I can't find it My.Settings.firstExecution in VS2005.
-
May 16th, 2008, 07:12 AM
#13
Re: First Run
 Originally Posted by talkro
Atheist, may I ask what version of VS are u using. I can't find it My.Settings.firstExecution in VS2005.
Im using both VS 2005 and 2008.
My.Settings exists on all versions of .NET that are of version 2.0 or above, and whenever you add a setting through the settings tab in the project properties, you can access it through the My.Settings property.
So in your case, you just havent added a setting called "firstExecution"
-
May 16th, 2008, 07:20 AM
#14
Fanatic Member
Re: First Run
ok, i get it.
use to access the values inside my setting with
vb Code:
My.Settings.Item("HasBeenRun") = True
instead of
lack of curiosity there from me.
-
May 16th, 2008, 08:27 AM
#15
Thread Starter
Lively Member
Re: First Run
Thanks for the update its appreciated i will post back and let you know the results soon
Many Thanks,
Stuart Jones
Network Manager
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|