PDA

View Full Version : Password Protection



rajroshan
12-08-2001, 01:04 AM
Hi All,
I have a problem to discuss with you all .
I have created a dilog box using SdShowDlgEdit2 function , in that szfields i have created fields namely user name and password and taking the two values from user i run isql utility(SQL SERVER UTILITY) which creates the user in the sql server.

Infact , i want the password field encripted like if user enters 123 then it must display like *** .
Is any body have the idea , how to perform this task ?
Is there any property to be set in install shield ?

i am using INSTALLSHIELD PROFESSIONAL 6.2 .

Pl. help me out ?

thanks in advance .

bye
raj

JacobLevin
12-09-2001, 11:07 PM
To make text in a text field appear as asterisks instead of the text you simply would have to set the "Password" property of the text field control in Visual Studio when you edit the resources for the dialog.

rajroshan
12-10-2001, 03:56 AM
hi JacobLevin !
thanks for your valuable suggestion but still i am unable to set that property . Infact i could not locate the place where to set password . here is my script for that dialog box

LOGIN :
nResult=SdShowDlgEdit2("Login Screen","Enter the login and password for SQL Server","Login Id:","Password:",login,password);

if nResult<0 then
// Report an error.
MessageBox ("SdShowDlgEdit2 failed.", SEVERE);
abort;
endif;


where login and password are the variable enters by the user and taking these two values i run the isql utility which creates the user in the SQL Server as per the given name by the user . here is the code for that

command="-U sa -Q \"EXEC sp_addlogin" + "'"+login+"'"+ ","+ "'"+password+"'"+","+ "'NetBilling'\" -P";

so, pl. tell me where to set that "password" property ?

thanks in adavance

JacobLevin
12-10-2001, 03:06 PM
You can't set this property from the script.

You would have to open the _isres.dll as a resource in Visual C++ and find the Dialog resource for the SdShowDlgEdit2 dialog ( you can find the resource ID for the dialog from the dialog sampler installed with the product ).

If you find that dialog and then find the edit field where you want the user to input the password. Double click on the edit field and a properties sheet should come up. One of the tabs will have a checkbox labelled "Password" if you check this and save the _isres.dll (this is only possible on NT/2K ) this will change that text field to a password field where all input is masked by asterisks.

rajroshan
12-11-2001, 06:21 AM
hi JacobLevin
once again thanks for your valuable contribution .Please clarify the following
1)Is it possible to open any .dll or _isres.dll as a resource in Visual C++ ?

I tried as directed to open it in VC++ resource pane but failed to open as i could not found any .cpp file for that .
I found Mfcdll.cpp in the C:\programe files\IS\Professional Standard Edition \MFC DLL\VC Project directory .
but i could not found any _isres.cpp file .

Infact i have not a good knowledge of VC++

so , once again i need your valuable inputs to resolve this problem.

bye

JacobLevin
12-11-2001, 08:47 AM
Yes it is possible to open the DLL as a resource.

There won't be any cpp files available - don't worry about this since you won't need them anyways.

If you open the DLL as a resource (there is an "Open As Type" option in the open dialog ) you should be able to see the resources for the DLL.

rajroshan
12-12-2001, 12:52 AM
hi,
i highly appreciate you to support me .
I am sending you an attached file , please see it .
Still i could not resolve my problem .

thks in advance

Best regards,

rajroshan
12-12-2001, 05:48 AM
hi JacobLevin
Please ignor the earlier reply (attached file) .
I have done it . Thanks for your valuable contribution but one more problem aries .Now the problem is i am using the SdShowDlgEdit2 dialog thrice in my script for various purposes like to insert some rows in database etc. etc.
The same field is coming as an astrick in all cases and i don't want it for remaining dialog boxes .
So , how to acheive it ?
the resource id is 12018 for this dialog box and i have checked the password property of it and it is reflected in all the cases .
So , pl. tell me how to resolve this issue ?

best of regards ,

JacobLevin
12-12-2001, 09:27 AM
That property will remain for that text field for every time you display that dialog.

In order to have the password property not set on some of the instances you would have to have to create a custom dialog that would look the same, but have that one different property for that text field.

rajroshan
12-17-2001, 07:29 AM
thanks ,
could not worked out with custom dialog box but now i have one more problem for that i am opening a new thread namely Writing binary values as subject .

wbr

miro_novotny
12-17-2001, 12:01 PM
It's simple to open DLL in VC++ as resource.
Things to do :
- run VC
- choose File/Open option , then "file types - executables", "Open as: Resources" and press Open.
- under "Dialog folder" find given Dialog and edit.
- click on textbox and press Alt-enter, then choose "Styles" tab and check "Password" checkbox
- save file
That's all.

But this is one way to do password editbox. I prefer to do custom dialog in _IsUser.dll. It is not hard to do and it works fine. IS contains this sample dll.

Miro

rajroshan
12-18-2001, 12:44 AM
hi Miro,
thanks for your reply .
Infact i have done it using sdShowDlgEdit dialog sampler. Could you tell me how to make custom dialog in _IsUser.dll , i mean the location of this dll in the project so i would use it instead ?Tell me the procedure also .

WBR,