|
hi may u please send me the answer too on the following email address:
mohd.dabaan@gmail.com
Thanks alot
Hamody
|
|
|
|
|
Is this an ASP.NET project ? VB.NET ? VB6 ? I'm surprised you're having trouble, and that so many other people have joined you in asking for this. What part of it is the issue ? My best guess is you want to restrict access to the rest of a site based on a username/password, to do this, your other pages need to verify a valid login, or redirect to the login page.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi christian,
This is a vb.net project and its a part of my school assignment, as you can see that i just started to learn vb.net so i'm having a hard time in this
its just a typical login form with user registration function and user database in windows application, i would appreciate if you could provide me the code, cause my deadline is next week, and i'm kinda desperate
|
|
|
|
|
It depresses me that schools are teaching VB.NET
As someone else said, this is either really easy, or really hard, depending on if you have any idea what you're doing at all. In a windows app, it's borderline trivial. Your app has two text boxes, it takes a user name and password, and then asks the database if they are valid. If not, it does not show anything else until something valid is entered. Which part of this can't you do, and is it because the project is too advanced for your course level, or because you've not done the prerequisite work ?
Does your app use the database already ? If not, a database is probably overkill just for this. You could use an XML or plain text file for this. The trick is to store the MD5 hash of the password instead of the password itself. If it DOES use a database, then I still cannot understand what part of this is confusing you. Please be more specific and I'll try to help. I also refuse to provide full code on such a trivial task, because it will defeat the purpose of your assignment.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The login screen part is simple, but I'm not supplying any code. Basically you need to have a text box to enter the username and a textbox for entering the password. The password box must have the PasswordChar attribute set to mask the typed password. I'm sure the user registration details are simple enough so that they need no explanation?
In regards to the database, how much knowledge of database systems do you have? What db are you going to use to store the details? Does it need to be a db or just a file on the file system?
Without this knowledge you (respectfully) have no hope of doing this with any confidence nor us assisting you.
...Steve
|
|
|
|
|
Need to create a combo box dynimcally in a datagrid? How can this be done? How to make the combo box invisible when scrolled to the header & above in the datagrid table?
hz
|
|
|
|
|
I copied the following code from this board and it doesn't work!
<
Module Module2
Delegate Function EnumWindows_Callback(ByVal hWnd As Integer, ByVal lParam As Integer) As Integer
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As EnumWindows_Callback, ByVal lParam As Integer) As Integer
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer
'The callback routine.
Function EnumWindows_CBK(ByVal hWnd As Integer, ByVal lParam As Integer) As Integer
Dim buf As String
Dim i, length As Long
' Get the window's title.
length = GetWindowText(hWnd, buf, 255)
Title = Microsoft.VisualBasic.Left(buf, length)
' See if the title contains the target.
i = InStr(1, Title, "Table")
If i > 1 Then
' Save the hwnd and end the enumeration.
g_TableHwnd = hWnd
Return 0
Else
' Continue the enumeration.
Return 1
End If
End Function
End Module
Private Sub doScreen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ptr As Integer
ptr = 0
' Examine the window names.
g_TableHwnd = 0
EnumWindows(AddressOf EnumWindows_CBK, ptr)
If g_TableHwnd = 0 Then
MsgBox("Error finding table.")
Exit Sub
End If
'Activate table.
ActivateTable()
GetTablePosition()
ThisValue = 0
potnum = 0
cardnum = 0
stacknum = 0
' Take back the focus.
Me.Activate()
End Sub
>
I only need the handle of the application with the word "table" in its caption so I removed a few things from the original code but not anything which should have effect the the ability of the code to loop through the active applications and return thier handles as emumWindows does in my vb6 code. This code is identical to my vb6 code except for the delegate and call back functions.
What happens id that "hWnd", which is passed to the <enumwindows_cbk> function is not "0" when it gets there from the form load sub. Instead it is some 6 digit number and on each iteration it becomes some other 5 or 6 digit number. It should start at 0 and work up one at a time.
I really need this function to work. My whole project is hung up on it.
Can anybody help?
Thanks
Dick Roose
|
|
|
|
|
dick roose wrote:
What happens id that "hWnd", which is passed to the function is not "0" when it gets there from the form load sub. Instead it is some 6 digit number and on each iteration it becomes some other 5 or 6 digit number. It should start at 0 and work up one at a time.
You seem totally lost. That's what happen when you copy code without knowing what it does. A HWND is a number that signifies a window on the system, it does not run from 0 onwards, but is correctly represented by the numbers you are getting.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need a calculator for VB.net that is small and only uses the keyboard for entering calculations and does not show buttons and has a tape form. Is this possible? Does anyone have one or code somewhere?
|
|
|
|
|
Yes it is possible. No I don;t have code. Try Googling it, you may find a hit or two.
...Steve
|
|
|
|
|
|
I know this isn't hard but as of late I've suffered a massive brainfart.
I'm populating a datagrid from a dataset, and I want to count the number of times each string appears in either of them (whichever is easier) and return that count to a label. However, I have to do this for all unique strings in the grid, and there is no definite number of strings to check against.
For example, the datagrid and the dataset it's populated with will look something like this:
ID | NAME
----------------------
1 | Bob
2 | Bob
3 | Joe
4 | Mary
5 | Joe
And I want the output (to be put into a label) to look like this:
Total Rows: 5
Bob occured: 2 times
Joe occured: 2 times
Mary occured: 1 time
And like I said, I will not only be checking for just Joe, Bob, and Mary, so hard-coding the strings I'm looking for isn't going to work.
Thanks in advance for any help.
-------------------
abort, retry, fail?
|
|
|
|
|
My SQL is limited at best, but I'm sure there's a way you can count occurances in the dataset. I know that ""SELECT DISTINCT " & psFieldName & " FROM " & sTable" will produce 1 result for each unique field name so there should be some variation of this that could give you a count. Sorry I can't be of more help.
|
|
|
|
|
I'll play around with that and see what I can do. I was looking for along the lines of iterating throught the result set after it's been fetched, but I suppose SQL can work, too.
-------------------
abort, retry, fail?
|
|
|
|
|
If you query it directly on the database something like the following should do the job:
SELECT NAME, COUNT(ID) FROM TableName GROUP BY NAME
If this is not possible something like this should do the job:
Dim hash As Hashtable
For Each row As DataRow In dataTable.Rows
Dim name As String = row("NAME").ToString()
If hash.ContainsKey(name) Then
hash.Add(name, 1)
Else
hash(name) = Convert.ToInt16(hash(name)) + 1
End If
Next
Dim result As String = ""
For Each name As String In hash.Keys
result = name & " occured: " & hash(name).tostring() & " times"
Next
|
|
|
|
|
thanks for your input. getting close, but now quite there - I've never used hash tables before, so I'm not sure how to handle this error:
Item has already been added. Key in dictionary: "TEST NAME" Key being added: "TEST NAME"
<br />
Line 72: Dim name As String = row("TLH_1_317").ToString()<br />
Line 73: If hash.ContainsKey(name) Then<br />
<font color="red">Line 74: hash.Add(name, 1)</font><br />
Line 75: Else<br />
Line 76: hash(name) = Convert.ToInt16(hash(name)) + 1<br />
your thoughts?
-------------------
abort, retry, fail?
-- modified at 12:09 Monday 10th October, 2005
|
|
|
|
|
all i had to do was change the
If hash.ContainsKey(name) Then
to
If Not hash.ContainsKey(name) Then
Thanks!
-------------------
abort, retry, fail?
|
|
|
|
|
Sh*t happens when quickly coding something out of the head
|
|
|
|
|
I have a popup menu handler. How do I figure out (preferrably the index) of the actual menu item selected?
Public Sub MyHandler(ByVal sender As System.Object, ByVal e As System.EventArgs)
' Need to know the index of the item selected here...
end sub
|
|
|
|
|
There is no "index" property per se, you can create a select and evalute the name of the sender:
Select Case Sender.Name
Case "lblSlot1"
end select
Or you could set the Tag property of each label to your index value then take the value of the tag:
piIndex = Val(Sender.Tag)
Those are my two best ideas anyway
|
|
|
|
|
Richard,
Thanks, for the idea but what I am refering to is did they select menu item #1, Menu items #2 and so-on.
I am sure these is a simple way, just have not seen it in the MS documentation yet...
Mike
|
|
|
|
|
The answer remains the same, the "sender" object is what was clicked. Evaluate the name you gave the menu item or set it's Tag property and look at that.
|
|
|
|
|
Each menu item can have methods that are triggered upon selection. If I have a popup menu (aka context menu) with three items: "One", "Two" and "Three" and I select menu item "Two" from the menu then my program will receive a "Two_Clicked()" event. You need to trap that event in your program and then (possibly) call your own generic handler from that event. That way you always know which item was selected.
...Steve
|
|
|
|
|
I have a handler for a context menu
Public Sub MyHandler(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
|
|
|
hello everyone,
i would like to code an application that can simply answer a call using the modem and log which keys (or in other words which dtmf commands are sent) are pressed. it's something i have never worked into so i am in need of help. through several web sites i've checked into this but the results i got (sample codes or articles) were not satisfactory. so if someone could feed me a sample that can simply log the buttons pressed by the caller or an address of an idiotproof article that would be useful i would be really grateful cause i simply couldn't figure out where to start. can there be a basic method of processing such commands from a modem, non-dependent of the chipset or does it have to vary with every different model?
thanks
|
|
|
|