Generating a program ID
-
I have a quick question. I have a program, and I need every instance of the program to have it's own uniqure ID. (E.G the first one opened has and ID of 12345, the second one has an ID of 74982, etc.) At the moment the only way I can see of doing this is getting the process ID. Is this the best way of doing it or are there other, better, ways of generating a unique ID? - Munty
-
I have a quick question. I have a program, and I need every instance of the program to have it's own uniqure ID. (E.G the first one opened has and ID of 12345, the second one has an ID of 74982, etc.) At the moment the only way I can see of doing this is getting the process ID. Is this the best way of doing it or are there other, better, ways of generating a unique ID? - Munty
-
I have a quick question. I have a program, and I need every instance of the program to have it's own uniqure ID. (E.G the first one opened has and ID of 12345, the second one has an ID of 74982, etc.) At the moment the only way I can see of doing this is getting the process ID. Is this the best way of doing it or are there other, better, ways of generating a unique ID? - Munty
Process ID is just fine; it is unique in that no two processes can be running simultaneously on the same Windows PC unless their processIDs are different. Why bother to try and come up with some other unique number ? :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
I have a quick question. I have a program, and I need every instance of the program to have it's own uniqure ID. (E.G the first one opened has and ID of 12345, the second one has an ID of 74982, etc.) At the moment the only way I can see of doing this is getting the process ID. Is this the best way of doing it or are there other, better, ways of generating a unique ID? - Munty
yup,if it is working with single process class which gurantee to be unique, then y to use time or random class.
Regards Chintan www.visharadsoft.com (Nothing is so purify as KNOWLEDGE)
-
I have a quick question. I have a program, and I need every instance of the program to have it's own uniqure ID. (E.G the first one opened has and ID of 12345, the second one has an ID of 74982, etc.) At the moment the only way I can see of doing this is getting the process ID. Is this the best way of doing it or are there other, better, ways of generating a unique ID? - Munty