在Silverlight Web应用程序中禁用打印屏幕和Ctrl键 [英] Disable print screen and ctrl keys in silverlight web application

查看:83
本文介绍了在Silverlight Web应用程序中禁用打印屏幕和Ctrl键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ..

我需要在我的Silverlight Web应用程序中禁用打印屏幕和Ctrl键.

如果用户按下打印屏幕或ctrl键,则需要传递一条消息按键已禁用".

怎么做..

需要您的建议..

问候
gopal.s

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

推荐答案

您想在服务器端还是客户端进行编码?
you wanna code in server side or client side ?


朋友,请尝试以下代码:
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>



如果您需要任何特定的...或服务器端代码,请告诉我,但是在此任务的最佳实践中,客户端脚本是合适的. (请对此回复评分)
谢谢,
Ambesha



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


这篇关于在Silverlight Web应用程序中禁用打印屏幕和Ctrl键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆