Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Silverlight5
hi..
 
i need to disable the print screen and ctrl keys in my silverlight web application.
 
if the user press the print screen or ctrl keys i need to pass a message "the keys are disabled".
 
how to do this..
 
need ur suggestions..
 
regards
gopal.s
Posted 20-Sep-12 20:14pm
Edited 20-Sep-12 20:16pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

you wanna code in server side or client side ?
  Permalink  
Comments
gopal_nivas84 at 24-Sep-12 2:33am
   
hi ambesha..
thanks for ur reply..
 
if a client the pressing the print screen key from his machine and i need to avoid that..
 
so for me whether its a client side or server side code but i need to control the print screen option from client machine during accessing my silverlight web appl.
 
need ur suggestions..
 
regards
gopal.s
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Friend, try the code below:
<html><head>
<script language="JavaScript"><!--
function clp_clear() {
   var content=window.clipboardData.getData("Text");
   if (content==null) {
      window.clipboardData.clearData();}
   setTimeout("clp_clear();",1000);}
--></script></head>
<body onload='clp_clear()'>
<center><font color=darkgreen><font size=3><p>
...Press the [PrintScreen] or the [Alt+PrintScreen] key and try to paste the content in your favorite Picture Editor (Paint,...)...<br>
...Select text and try to paste the content in your favorite Text Editor (Notepad,...)...<p><font color=black><font size=2>
This small script clears the clipboard at runtime and disables screen capture process...but does not disable text selection..</center>
<hr>for more Ambesha blog, please visit <a href="http://ambeshdevloper.blogspot.com/">http://ambeshdevloper.blogspot.com/</a>[<a href="http://ambeshdevloper.blogspot.com/" target="_blank" title="New Window">^</a>] </body></html>
 
Please let me know if you want any specific...or server side code but in best practice for this task client scripting is appropriate. (please rate this reply)
Thanks,
Ambesha
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Nirav Prabtani 318
1 OriginalGriff 227
2 Sergey Alexandrovich Kryukov 216
3 Mika Wendelius 185
4 CPallini 170
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Sergey Alexandrovich Kryukov 196
3 Mika Wendelius 185
4 CPallini 170


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100