-
[RESOLVED] How to make a login form please?
Dear Experts,
Has anyone know the code how to make a login form which the scenario like this...for an example, if I click words.exe, it will show up the pop up form to fill login and password before the .exe file opened...otherwise, it wont open...
Thank you very much for your kind helps...
Jennifer ;)
-
Re: How to make a login form please?
first, you have to construct a login form then make that form your startup form then make the code so that your main form wont show until you input the correct login information
-
Re: How to make a login form please?
Quote:
Originally Posted by lerroux
then make that form your startup form
What do you mean by this please..???..for instance, I only would like to show this login form for Microsoft Words only.... :confused:
Please explain to me more.... :)
Thank you very much..
Jennifer
-
Re: How to make a login form please?
Use WinRAR, RAR them and password the RAR.
-
Re: How to make a login form please?
you mean you want to make login forms for another app? like winword?
-
Re: How to make a login form please?
Yes...what I mean is to make a login form for any kind of .exe files...my question is, I dont know how to put this form into the start up...Would you please explain to how..???
Thanks a lot...
-
Re: How to make a login form please?
You could rename the word.exe to something that you only know, and then name your app word.exe, so that all shortcuts point to your app. Then, if they log in correctly, you would shell (and possibly pass along command$) the word.exe that had been renamed. You would also have to mimic the command$ if the user decided to just right click on a document and select PRINT only.
The other option, would be to write your own explorer, but that would be a lot of work. It'd be worth it if you want to control other apps as well.
If you have XP Pro, you could password protect the WORD folder, so that only the correct user could access the files.
Because word interacts with so many things, it might be a better idea to just include it for a particular user. Others wouldn't have it on thier menu, and you could configure Outlook to not use word for them, for instance.
-
Re: How to make a login form please?
Hi,
Thanks for all of your inputs...But, I would like to make it a login form using vb...and I really need the code please...????
Thanks,
-
Re: How to make a login form please?
Depends on how secure you need it. There would be loads of ways to get around for an app like word. One way to do it would be to use a file packer and pack your app and the exe into one file, when run your app would open first with the login form... if the details are put in wrong then dont unpack the exe etc.. winrar with a password is the same idea.
-
Re: How to make a login form please?
How about like this...
On the desktop, when you double click on the .exe file, let say words.exe...then before it open, it will show first the pop up window form for login and password...if the username and password are correct, then it will call the "word.exe" file otherwise if it is wrong, it will close the form and wont open the word.exe.....
What is the code behind this login form created by VB please..???
Thanks,
-
Re: How to make a login form please?
VB Code:
Private Sub Command1_Click()
If text1.Text = "password" Then
Shell "c:\program files\words.exe"
Else
MsgBox "wrong password"
End If
End Sub
-
1 Attachment(s)
Re: How to make a login form please?
Hi This is Code for Login Form
Option Explicit
Public rstat As String, delstr As String, Rowflag As String, Flag As String
Private Sub cmdCancel_Click()
cbousername = ""
txtPassword = ""
cboworkgroup = ""
cboworkgroup.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
'MDImain.Picture1.Visible = True
'MDImain.idea.Visible = True
End Sub
Private Sub cmdOK_Click()
Dim CnDb As New ADODB.Connection
Set CnDb = New ADODB.Connection
CnDb.Open "Provider = Microsoft.Jet.OleDB.4.0;Data Source = C:\Program Files\Microsoft Visual Studio\VB98\Prepaid Management System\Login.mdb"
Dim rsUser As ADODB.Recordset
Dim sSQL As String
Set rsUser = New ADODB.Recordset
sSQL = "Select * From Userlogin Where User_name = '" & cbousername.Text & "' And User_password = '" & txtPassword.Text & "' And Workgroup = '" & cboworkgroup.Text & "'"
rsUser.Open sSQL, CnDb
If rsUser.EOF Then
MsgBox " Password Entered is Invalid.......Try again!!!!", vbOKCancel
txtPassword = ""
txtPassword.SetFocus
Else
Frmlogin.Hide
'MDImain.Picture1.Visible = True
'MDImain.idea.Visible = True
' MDImain.Toolbar1.Enabled = True
MDImain.StatusBar1.Panels(3).Text = cbousername.Text
MDImain.StatusBar1.Panels(4).Text = cboworkgroup.Text
Call MsgBox("Welcome to World of Prepaid... ", vbOKOnly + vbInformation + vbApplicationModal + vbDefaultButton1, "Welcome")
End If
End Sub
-
Re: How to make a login form please?
Quote:
Originally Posted by Jmacp
VB Code:
Private Sub Command1_Click()
If text1.Text = "password" Then
Shell "c:\program files\words.exe"
Else
MsgBox "wrong password"
End If
End Sub
Hi,
It works..!!!...Thanks a lot...BUT, I have two questions:
1. How to make the password fonts as star or dot (like usual symbol of password)..??
2. How to make it like this: when I double click on WINWORD.exe it will show up this form first before opening WINWORD.exe...
Thank you very much for your kind helps..
Jennifer ;)
-
Re: How to make a login form please?
Quote:
Originally Posted by zach007
1. How to make the password fonts as star or dot (like usual symbol of password)..??
Place a * in the PasswordChar property of the textbox.
Quote:
Originally Posted by zach007
2. How to make it like this: when I double click on WINWORD.exe it will show up this form first before opening WINWORD.exe...
You would have to compile your program, and use it, rather than a desktop shortcut to execute Winword. If Word is stored locally, however, there will be nothing preventing anyone from navigating to the folder that WINWORD.EXE is stored in, and double clicking directly on it, which will bypass your program.
-
Re: How to make a login form please?
Hi,
Thanks a lot for your reply...However, is it possible to play with regedit to make this happen please..???
-
Re: How to make a login form please?
Quote:
Originally Posted by zach007
Hi,
Thanks a lot for your reply...However, is it possible to play with regedit to make this happen please..???
If you are asking about the possibilities of having your program executed when someone double clicks on WINWORD.EXE, I don't think so.
-
Re: How to make a login form please?
Store winword.exe in a resource file (see my sig on how to do this) and delete the original winword.exe then,
1) Find the path to the original winword.exe c:\program files\msoffice\word\winword.exe etc.. and use this path is my code instead of,
in the line,
VB Code:
Open App.Path & "\words.exe" For Binary Access Write As #1
and in the line,
VB Code:
Shell App.Path & "\words.exe"
then add this code to your app,
VB Code:
Private Sub Command1_Click()
If Text1.Text = "username" And Text2.Text = "password" Then
Dim b() As Byte
Open App.Path & "\words.exe" For Binary Access Write As #1
b = LoadResData(101, "custom")
Put #1, , b
Close #1
Shell App.Path & "\words.exe"
Else
MsgBox "wrong password"
End If
End Sub
and run the app. You can extract resources from any exe(in this case the winword.exe file) unless you protect the exe against this.
EDIT:
Ok this isn't really goin to work as once you hav extracted the winword.exe then its there somebody could copy it or whatever so you would need need to find an app that prevented anybody copying or altering files in the office folder.
-
Re: How to make a login form please?
Quote:
Originally Posted by zach007
Yes...what I mean is to make a login form for any kind of .exe files...my question is, I dont know how to put this form into the start up...Would you please explain to how..???...
Any kind of Exe files?
Why don't you just manage Windows permissions from Windows Profiles?, where only admins have open/execute rights with EXE files. That way you don't have to worry about creating password accounts, it would be all managed by Windows, and you won't need to use that login Form for EVERY exe file in the computer. :sick:
-
Re: How to make a login form please?
Hi,
I know...I only want to know if I create in VB...that is it...anyone knows who can put this login.exe in registry...I mean can I play with the registry..???
-
1 Attachment(s)
Re: How to make a login form please?
Quote:
Originally Posted by dglienna
You could rename the word.exe to something that you only know, and then name your app word.exe, so that all shortcuts point to your app.
That gave me an idea.
In the ZIP attached, you will find 2 applications, AppPassword is the one that is asking for the log in, and App1 is my test application (I tested this on the App1 test app so that I don't delete real applications by mistake)
I tested it with a real application like WinAmp, and it worked also.
The main program is AppPassword.
You HAVE to compile before you do anything...
(For testing compile the App1 application also)
There are 2 logins you can type:
Admin - pass09 (actually it's "pass" and todays date)
user - pass09 (pass & todays date)
Run the AppPassword, and type the Admin user and password.
Browse for the EXE you want to protect, then lcik on "Password Protect EXE"
Hopefully there won't be any problems.
When you get the "Done !" mesage box, click OK
Now you can run the application you wanted to password protect, and type "user" username and passord.
And the applicated that is protected will run.
How it works:
The program copies itself as the same file name as the file you want to protect, and it copies the real application as an ADS file.
When you enter the right username and password it will shell the reall application.
-
Re: How to make a login form please?
So, no one likes it ? :( I thought it was a pretty good idea
-
Re: How to make a login form please?
Hi...dont be sad...I will try it, I just wanna try it now...I will get back to you once I have tried...so, wait for a while... :)
-
Re: How to make a login form please?
Hi,
When I tried to make .EXE project, there are two errors:
VB Code:
If chkBackup.Value = 1 Then
Name Me.txtFileName.Text As RightLeft(Me.txtFileName.Text, ".") & "_bak.exe"
End If
and it highlighted with blue in "RightLeft"
and:
VB Code:
Shell App.Path & "\" & App.EXEName & ".exe:" & App.EXEName & ".exe", vbNormalFocus
For this statement, all are highlighted in yellow...
What is wrong with this..????
-
1 Attachment(s)
Re: How to make a login form please?
Ups, I forgot to include the attached module in the zip...
Add this module to the project
Sorry...
[Edit], I modified the previous post, and included this module in it also...
-
Re: How to make a login form please?
Quote:
Originally Posted by zach007
VB Code:
Shell App.Path & "\" & App.EXEName & ".exe:" & App.EXEName & ".exe", vbNormalFocus
For this statement, all are highlighted in yellow...
What is wrong with this..????
It will work after you fix the problem with missing module.
-
Re: How to make a login form please?
Sorry, what do you mean by missing module please..??..Would you please explain to me in further detail..???
-
Re: How to make a login form please?
Add the last module (bas file) to the app program's folder, then open up the IDE, and add a module. Select the new module, save the project, and try running it again.
-
Re: How to make a login form please?
Hi,
I really dont know what you mean..honest...Why dont you put example codes or codes which is better to understand by me...
Thanks...
-
Re: How to make a login form please?
Just download the module that CV posted in post #24, and follow my previous instructions. He forgot to include it in the zip file that you were trying to run, and added it in post #24. To add the module to a project, click Project on the menu of the IDE, and click Add Module, then select the Existing Tab. If you added it to the same folder the rest of the code is in, you will see it. Click on it, and this will add it to your project. Save it, and run it. (compile it first if that's what he said. I forget right now.)
Modules are just common blocks of code that you can use in multiple projects, so you don't have to re-write everything from scratch for each project.
EDIT: He did say that you have to compile this project, and also the App1 project (which is password protected) You can then use any .exe, but for testing, use the App1.exe that gets compiled from the App1 project.
-
Re: How to make a login form please?
Thanks for the help DG, I was very busy today, so I did not had time to check my messages until now...
-
Re: How to make a login form please?
Quote:
Originally Posted by Jmacp
Store winword.exe in a resource file (see my sig on how to do this) and delete the original winword.exe then,
1) Find the path to the original winword.exe c:\program files\msoffice\word\winword.exe etc.. and use this path is my code instead of,
in the line,
VB Code:
Open App.Path & "\words.exe" For Binary Access Write As #1
and in the line,
VB Code:
Shell App.Path & "\words.exe"
then add this code to your app,
VB Code:
Private Sub Command1_Click()
If Text1.Text = "username" And Text2.Text = "password" Then
Dim b() As Byte
Open App.Path & "\words.exe" For Binary Access Write As #1
b = LoadResData(101, "custom")
Put #1, , b
Close #1
Shell App.Path & "\words.exe"
Else
MsgBox "wrong password"
End If
End Sub
and run the app. You can extract resources from any exe(in this case the winword.exe file) unless you protect the exe against this.
EDIT:
Ok this isn't really goin to work as once you hav extracted the winword.exe then its there somebody could copy it or whatever so you would need need to find an app that prevented anybody copying or altering files in the office folder.
My project is very similar to this..
My major concern, however, is how to prevent the user from copying the 'extracted' exe file..
I'm still having tough time to make the login application delete back the extracted exe file once the user exits.
How about using OLE to embed the exe file?