Set Password in window application?
I made a win application and I give a registration form to register first to Login in software but I want to set a password for the regitration form that the other user could not create their account without the validation of admin untill he does not provide the password.
And I want that this password should be show when the user install the开发者_JAVA技巧 application and when application finished installation it should give the password through a massage box. Is it possible to generate the password random for diffrent computers?You can use the processorID in most cases, or the mac address, or just a plain old random large number (if it does not need to be the same for all times that computer installs the program).
You could either generate a random string/integer with, for example the Random Class:
Random r = new Random();
r.next(1,1000);
Or you could make the password using a constant string on the computer, as for example the CPU ID or any other hardware ID.
To make the progress more secure, you could hash die password using MD5 oder SHA-2
you can generate different password for different computer by getting unique id of computer relating hardware
精彩评论