Check Caps Lock Status
-
hello, I want to restrict user to access my site if his Caps Lock Key is Off, so i need to check caps lock status whether he presses a-z,A-Z,or 0-9 keys in asp.net code. i have tried following code which is working on Local but not on Server if (Console.CapsLock) { lbl.Text="Caps is on"; } thanks
-
hello, I want to restrict user to access my site if his Caps Lock Key is Off, so i need to check caps lock status whether he presses a-z,A-Z,or 0-9 keys in asp.net code. i have tried following code which is working on Local but not on Server if (Console.CapsLock) { lbl.Text="Caps is on"; } thanks
It is clearly understood that you have no idea about web applications. ASP.NET can't check the keyboard's caps lock status. If you have a text box, hook a JS
OnKeyPress
event and check the ASCII values of the key pressed. This will give you the typed letters case. But still you will not get the caps lock status. This should be the best question posted in ASP.NET forums this week. :)Best wishes, Navaneeth
-
It is clearly understood that you have no idea about web applications. ASP.NET can't check the keyboard's caps lock status. If you have a text box, hook a JS
OnKeyPress
event and check the ASCII values of the key pressed. This will give you the typed letters case. But still you will not get the caps lock status. This should be the best question posted in ASP.NET forums this week. :)Best wishes, Navaneeth
so this means we can get caps status only if v r using letters(a-z) not digits(0-9) or we are using windows application. thanks for ur reply
-
so this means we can get caps status only if v r using letters(a-z) not digits(0-9) or we are using windows application. thanks for ur reply
I reiterate. You CANT get the caps lock status in web application.
11Developer wrote:
so this means we can get caps status only if v r using letters(a-z) not digits(0-9)
Numbers don't have a case so that question is irrelevant. You can get the case of a-z of course. As I said, get the ASCII code and compare. Why you need to get the caps lock status? If you can tell us what are you trying to solve, there should be a better solution.
Best wishes, Navaneeth
-
I reiterate. You CANT get the caps lock status in web application.
11Developer wrote:
so this means we can get caps status only if v r using letters(a-z) not digits(0-9)
Numbers don't have a case so that question is irrelevant. You can get the case of a-z of course. As I said, get the ASCII code and compare. Why you need to get the caps lock status? If you can tell us what are you trying to solve, there should be a better solution.
Best wishes, Navaneeth
i want that user can't logged in if his caps lock is not ON, this is a security feature which is not known to anonymous users and for logging in he has to enter numbers not letters.So hw to validate dis sceneraio????
-
hello, I want to restrict user to access my site if his Caps Lock Key is Off, so i need to check caps lock status whether he presses a-z,A-Z,or 0-9 keys in asp.net code. i have tried following code which is working on Local but not on Server if (Console.CapsLock) { lbl.Text="Caps is on"; } thanks
Judging by your communications with Navaneeth, there are some serious gaps in your knowledge. When he says "ASP.NET cannot get the caps lock status" what he means is: It is physically impossible for an ASP.NET application to find out the caps lock status on a user machine. Why? Because when you execute an ASP.NET application, the code you write is executed on the SERVER not the CLIENT. The Client machine is the one with the user, and the keyboard. So the Server cannot know what the User keyboard is doing. It is similar to this: If you call me on the phone, can you smell my coffee? You are the Server, I am the Client. Can you even tell if I have a cup of coffee? You cannot implement your "security" feature. And even if you could, just how "secure" do you really think it is? Go, google ASP.NET Membership Class, and think again.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
Judging by your communications with Navaneeth, there are some serious gaps in your knowledge. When he says "ASP.NET cannot get the caps lock status" what he means is: It is physically impossible for an ASP.NET application to find out the caps lock status on a user machine. Why? Because when you execute an ASP.NET application, the code you write is executed on the SERVER not the CLIENT. The Client machine is the one with the user, and the keyboard. So the Server cannot know what the User keyboard is doing. It is similar to this: If you call me on the phone, can you smell my coffee? You are the Server, I am the Client. Can you even tell if I have a cup of coffee? You cannot implement your "security" feature. And even if you could, just how "secure" do you really think it is? Go, google ASP.NET Membership Class, and think again.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
Thanks for the reply... but i have to search for it as it is my duty to obey my uneducated seniors.....
-
Thanks for the reply... but i have to search for it as it is my duty to obey my uneducated seniors.....
Then educate them! A stupid idea does not become a good idea just because a manager proposed it, no matter how much they think it should.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
i want that user can't logged in if his caps lock is not ON, this is a security feature which is not known to anonymous users and for logging in he has to enter numbers not letters.So hw to validate dis sceneraio????
Write a windows app. Or you may be able to do it with a Silverlight web app. Also, clean out your ears, you've been answered. Finally, when you're talking to a client, have some idea about the technology first, instead of assuming that we'll do your work for you. Nodding the whole time is not productive, you end up promising things that are not possible.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Thanks for the reply... but i have to search for it as it is my duty to obey my uneducated seniors.....
11Developer wrote:
. but i have to search for it as it is my duty to obey my uneducated seniors.....
ROTFL - you plainly started as uneducated as they are. If you're the programmer, it's your JOB to tell them when something is not possible. If you were to learn about ASP.NET before you started in this job, you could have done that in the first instance, instead of after the fact.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
i want that user can't logged in if his caps lock is not ON, this is a security feature which is not known to anonymous users and for logging in he has to enter numbers not letters.So hw to validate dis sceneraio????
Who cares about the user having the caps lock on or off If you want it secure, make sure the users have a very strong password and also make it case sensitive There are meny thing that you can do server side to make an app secure, but as everyone here ahs told you, it is not possible to check the caps lock status fromm the server side The only option is as someone else already told you, use javascript and as soon as the users types something do the check with javascript
Alexei Rodriguez