|
i m inserting the code here, i want to add the administrator and general users and also to provide the facility to change his/ her password or name.
so plz help me...
________________________________________________________________
Public Class FrmLogin
Dim dsetsearch As New DataSet
Dim dsetusertype As New DataSet
Private Sub FrmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
dsetsearch.Clear()
If Me.txtuname.Text = "" And Me.txtupassword.Text = "" Then
MsgBox("User Name or Password not found", MsgBoxStyle.Information)
Exit Sub
End If
If Me.txtuname.Text <> "asif" And Me.txtuname.Text <> "imran" Then
MsgBox("Invalid User Name", MsgBoxStyle.Information)
Exit Sub
End If
gridfill("select * from Login where UserName = '" & Me.txtuname.Text & "'")
adp.SelectCommand.ExecuteNonQuery()
cn.Close()
adp.Fill(dsetsearch, "Login")
If Me.txtupassword.Text = CType(dsetsearch.Tables(0).Rows(0).Item(1), String) Then
Frmstartup.Show()
Me.Hide()
Else
MsgBox("Invalid User Name or Password ", MsgBoxStyle.Information)
End If
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
End
End Sub
Private Sub txtuname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtuname.KeyPress
If Char.IsLetter(e.KeyChar) = False Then
If e.KeyChar = CChar(ChrW(Keys.Back)) Or e.KeyChar = CChar(ChrW(Keys.Space)) Then
e.Handled = False
Else
e.Handled = True
End If
End If
End Sub
End Class
asif rafiq
|
|
|
|
|
1 - don't ever pull the real password into your app
2 - it's best to never hard code a user/password, it means it cannot be changed
3 - use Char.IsControl to work out if a control character has been pressed
4 - what do you want to do ? Add users based on their role on the PC, so check if the user is an admin on the machine, and if so, they are in ? why ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
5 - SQL Vulnerability (?)
|
|
|
|
|
asifullahkhan wrote: gridfill("select * from Login where UserName = '" & Me.txtuname.Text & "'")
Very interesting query. Your database has good avenues or windows for easy cleanups. Wouldn't it be?
|
|
|
|
|
Hi all!
I want to figure out how I could place scrollbars onto a panel so that I could see things in the panel that are located outside the panel dimension.
The reason for doing this is because the panel is used as a canvas for the charts that I have drawn onto using the graphics object. Since the preset panel dimension could not be able to show everything. help needed!
thanks in advance!
jensen
|
|
|
|
|
Did you try placing it within a Scrollable DIV?
|
|
|
|
|
Where in his post did it say he was using ASP.NET??
|
|
|
|
|
Draw your stuff on one panel and place that panel inside another. Just set the AutoScroll property of the parent container panel to True.
|
|
|
|
|
Hi Dave, Thanks for the reply,
It works!
But i'll have to manual set the panel's dimension to be bigger than the parent panel as the panel won't automatically resize when i've drawn stuff over its boundaries and because of it the parent panel's autoscroll wont' kick in..guess ill just have to code a line to change the dimension of the child panel to resize whenever i start drawing over the initial dimension.
if (panels.width/height) < (drawn item location) then
panels.width/height = something larger..
|
|
|
|
|
I am having tif files that i have to convert into pdf files. Please help me.
Sivaraman
|
|
|
|
|
|
Hi,
Does anyone know how to use visual basic to transfer 8 bts of data (1 stop bit) with standard frame. It will be use to control the motor speed. Please let me know if you know how to do it. Thank you very much for your help
Regards,
Nina
|
|
|
|
|
You might want to specifiy upon WHICH INTERFACE you are transfering this lonely byte. Without knowing this vital piece of information, it's impossible to answer your question.
|
|
|
|
|
Hi Dave,
The data is to be sent through a serial port, COM1.
Can you show us how to send and receive data using MS_Comm?
We are using VB6.
[Continued from Nina's Question]
Paul
-- modified at 21:37 Saturday 1st September, 2007
|
|
|
|
|
In a previous program, I was able to open Excel and have it running in the background. Now I use the same (similar except the names) code in a different program and get the error message " 'New' cannot be used on an interface".
Private Sub Admin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
xlsApp = New Excel.Application<br />
xlsApp.Visible = False
Previously in the original tuition program, there was no objection to the code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
xlsApp = New Excel.Application<br />
xlsApp.Visible = False
What am I not switching on?
Please someone help?
Frank
|
|
|
|
|
hi frank
have you check to include the references of Microsoft.office.interop services
i also use this type of code but that's little bit different but that's work
i think your error is concerned with some thing else not with "new".
i use
Dim newexl As New Microsoft.Office.Interop.Excel.Application<br />
Dim workbookexl As Microsoft.Office.Interop.Excel.Workbook = newexl.Workbooks.Add()<br />
Dim sheetexl As Microsoft.Office.Interop.Excel.Worksheet = workbookexl.Sheets(1)
this try this out.
help everyone
|
|
|
|
|
Hi, I tried...
Dim newexl As New Microsoft.Office.Interop.Excel.Application<br />
Dim workbookexl As Microsoft.Office.Interop.Excel.Workbook = newexl.Workbooks.Add()<br />
Dim sheetexl As Microsoft.Office.Interop.Excel.Worksheet = workbookexl.Sheets(1)
And it is underlining the Microsoft.Office.Interop.Excel.Application
and saying "Type 'New Microsoft.Office.Interop.Excel.Application' is not defined"
I still feel that something isn't plugging right, but do know for sure what. Maybe cause I cut and pasted some references in as they didn't appear available from the 3 tabbed drop downs in Project/Add Reference.
|
|
|
|
|
|
Hi, I need help to change the primary SMTP proxy address of some users.
My users are in OU="user"
The proxyaddress of them are the following
SMTP: user1@test1.local
smtp: user1@test2.local
I need a script that change it in the active directory.
At the end of the script the proxyaddress of the user must be:
smtp: user1@test1.local
SMTP: user1@test2.local
Please, help me ...
Thanks
|
|
|
|
|
I am trying to fill a dataset and update a dataset to change values in a database. I have a third party program entering records in mydatabase. My program fills a dataset. I do some processes and update the dataset to update the mydatabase. All works well, until I factor in the fact that I want to watch the database and update a field when a record has a certain value so, I watch to see if any changes and Onchanged is called then I test the varables and if the record has a certain value I want to change a different value. But, then the Onchanged event is called again and I am in a endless loop of calling the method, changing the variable, calling the method, changing the variable. What would you suggest?
|
|
|
|
|
|
That won't work on an Access database.
|
|
|
|
|
There's no reliable way to do this in Access. Access doesn't support triggers, so your kind of screwed.
You could use the FileSystemWatcher, but there's a problem with this. In order to get this to work, your Changed event would have to set a flag when it see's a change made and need to make its own change. This flag would tell the Changed event that it should ignore the event when it gets called again and then reset the flag.
Private Sub ChangeEvent(blah, blah) Handles ....
Static updatingDatabase As Boolean = False
' A change to the database has been detected.
' Check the flag to see if WE made the change, or if an outside
' source made the change.
If updatingDatabase Then
' We're making the change. Reset the flag
' and do nothing.
updatingDatabase = False
Else
' An outside source made the change.
' Set the flag and make our changes to the database.
updatingDatabase = True
' Do you database update here.
End If
End Sub
Now, there is a large problem with this. If the outside source makes a change to the database while this code is running, you can't tell the different between your code making the change and the outside source making the change. It's entirely possible that the outside source changes the database and your code will never see it.
There is simply no way to do this reliably in Access. SQL Server, even the FREE Express Edition, support Triggers, that will easily allow you to do this in the SQL code of your database.
|
|
|
|
|
I have been seeing the following code I do not know what the characters mean
in a web page
<%$ Tranlate: any string value %>
I know that translate is a function in the code and it is translateing the any string value to another string but could you tell me what the $ means how is it different then <%# and what the : does
In some code I also find
NewRow!somefield = somevalue
what does the ! mean and what does it do
Thanks
|
|
|
|
|
I don't know about the first one, but "!" when late-bonding is the same as "." when early-bonding.
<code>
Dim FSO
FSO = CreateObject("Scripting.FileSystemObject")
' This line of code is unknown to compiler:
Call MsgBox (FSO.DriveExists("D:"))
' So use this instead:
Call MsgBox (FSO!DriveExists("D:"))
</code>
|
|
|
|