Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I wonder if you guys can help me, how can I do a method just in my application's first run.
for e.g I want to write a registry key or create a file or checking existence of a file at the first time my application is executed; and other times it is executed the method will be ignored.
Posted

1 solution

I have a whole CodeProject article devoted exactly to this problem. Please see:
Wish You Were Here… Only Once[^].

Please see: this is pretty interesting. Even though my main very sophisticated method is very unusual and is developed mostly for fun, it is fully functional, based on the CLI standards, effective and demonstrates using very non-trivial technique. Besides, regular, non-esoteric approach to the problem is fully explained and discussed.

—SA
 
Share this answer
 
v2
Comments
Mostafa M.A 15-Aug-12 22:18pm    
thanks
it's exactly what I want, but as you said before my knowledge is not enough to understand whole code.
actually I didn't understand most of it's parts.
hope that I'll understand all of it soon.
you know, I don't have such a lot of free time to go on C# programming, because this is not my main field in university. I study Civil Engineering...
so it might take such a long time for me to get familiar and to be expert in C#.
I really thank you for your kind answers to my problems
Sergey Alexandrovich Kryukov 15-Aug-12 22:25pm    
You don't have to understand the code -- it is well tested (you can easily test it with your code) and documented, you can just build my assembly, reference it and use in your projects as shown in the usage samples. The implementation is really tricky; as a matter of fact, I did not expect you to understand it; nevertheless, it is quite reliable, because only the conception and ideas are hard to understand, the implementation itself is very short and simple. If you keep interest to this matter and want to understand some detail later, I'll gladly answer your question.

Besides, look at the very beginning of the article to see what people would "usually" do.

So, anyway, please accepting the answer formally (green button) -- thanks. It is kind of quite comprehensive.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900