Rift
xTeam
Please! I am Ugoff ?~?
Posts: 201
|
Post by Rift on Oct 19, 2003 14:53:52 GMT -5
Im trying to set two variables in my program.. say V1 and V2 when the program opens it automatically sets V1 and only sets V2 if V2 returns nothing. If V2 returns a value it compares V1 to V2 and checks for a match, if they do not match, the program closes. Im doing this because i want to make my program shut it'self if it gets sent to another machine once it's already been opened. Basically im going to set V2 and V1 based on a number of different things related to my computer that another computer wont be able to replicate by default.
The problem im having with this, is i do not want to write a variable to somewhere outside of the program, like the registry or another file. This is because if the exe is distributed i want it in the exe it's self. I cant seem to declare any variables that will continue to hold the data next time i open the program unless i set the variable data to an external file, or registry key... Im hoping this somehow makes sense lol.. if not ill clarify more upon request lol
Rift
|
|
Maverick
New Member
www.mavetech.tk
Posts: 174
|
Post by Maverick on Oct 19, 2003 15:07:15 GMT -5
there will be nothing u can do to solve this as all variables are killed as soon as u close the program...... anywayz u can use a text file associated with the exe so u get the values from the texfile and then compare them... but u have to use a trick here as u can save the textfile as an .ini file so users will think its an important file to keep the program running ...... if u need some code just ask for one and i will be pleased to help
|
|
Rift
xTeam
Please! I am Ugoff ?~?
Posts: 201
|
Post by Rift on Oct 19, 2003 15:30:33 GMT -5
i could just as easily use a .reg file that they wont find, lol but the idea is to write to the program, ive been given one idea to have a seperate program run the base program and open it for writing, write to the proper offset, and then save the exe, which seems very easy once i find the proper offset, btw.. so no one thinks im that stupid, i know a raw copy of this could be distributed before it ever gets sent to anyone, lol, they will have to register it in the first place. btw thanx for the suggestion
|
|
|
Post by Lazer on Oct 19, 2003 16:31:51 GMT -5
so basicly u wont to set 2 variables and if they both match u want to exit the programme ?
|
|
|
Post by Webagent on Oct 19, 2003 16:37:13 GMT -5
|
|
Rift
xTeam
Please! I am Ugoff ?~?
Posts: 201
|
Post by Rift on Oct 19, 2003 17:22:58 GMT -5
ty web ill check that out, and sorta, lazer, if the two vars dont match, it will exit out, the vars are equal to a set of data unique to my pc, so if it gets sent off to another one, it will know and shut it's self
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on Oct 19, 2003 22:54:39 GMT -5
I don't really think this is possible unless you use an external file or figure out some way to recompile the program each time lol ;\
|
|
|
Post by Dangermouse on Oct 20, 2003 1:53:44 GMT -5
Only way i thought of was connecting to a web server, have a php page to use the query string to add data to a db, and also to check if its already in the DB and return info. And have a way of checking if you're connecting to the net, else the program exits
|
|
Maverick
New Member
www.mavetech.tk
Posts: 174
|
Post by Maverick on Oct 20, 2003 2:43:48 GMT -5
yes i think all ways mentioned will work but his will not as i said b4 variables are killed when u exit the program and new ones are created when u start it again with nothing inside unless u assign a value
|
|
Rift
xTeam
Please! I am Ugoff ?~?
Posts: 201
|
Post by Rift on Oct 20, 2003 16:03:02 GMT -5
hmm thanks for all the helpfull suggestions ill try to make something work from all of them if anything ill skip out on that for now and just try to find a way to make it need registration.. i already have ideas for that though:P -Rift-
|
|
|
Post by AbsoluteGenius on Oct 25, 2003 15:35:00 GMT -5
Best solution to this is as follows (but i wont go into too much detail)
you need to write to the registry - not just anywhere - and not using the writesetting getsetting function
bes tplace to hide this sort of thing is in the Classes area and make up a key entry that means nothing at all
and encrypt the string you save
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\
if you take a look there there are millions of entries
its where i hide the locking code for my old IRCDominator and other projects in the past.
unless some one wants to really find it they wont have a clue. and aslong as you encrypt it to hold a checksum also then they cant alter it to make it work
then all you do is read it and decrypt it and use it
|
|
Rift
xTeam
Please! I am Ugoff ?~?
Posts: 201
|
Post by Rift on Oct 25, 2003 17:54:00 GMT -5
lol that's exactly where i put it, lol i remember what a pain in the a$s it was looking for certain clsid's lol so i gave it it's own random key in the registry under all the clsi'ds great suggestion
|
|
DeeEmm
New Member
Industrial Software Engineer / Robot Programmer
Posts: 16
|
Post by DeeEmm on Oct 29, 2003 10:54:40 GMT -5
Have a look at writing your code using classes, you can create a class object and then embed it in a normal .exe for distribution, the good thing about doing this is that it allows you to store data after the app closes it does this in the ocx. Ok so you have some more files to deploy with your package but it does exactly what you need.
Its a much better way of coding anyhow - you can distribute the ocx as a stand-alone and then allow others to use it by way of the class statements - plus you can also have multiple instances and multi threaded tasks - which you cant do with a standard exe.
Look in the msdn visual library for the tutorial - 'shape changer' i think its called - will give you a basic start.
|
|
Rift
xTeam
Please! I am Ugoff ?~?
Posts: 201
|
Post by Rift on Nov 3, 2003 15:54:27 GMT -5
Thanks for the suggestion, sounds like a great idea, ill just have to try and have a better search for it, havent had any luck finding a similar article on msdn.. of course im good for skimming right past text sometimes
-Rift-
|
|