zoukankan      html  css  js  c++  java
  • 有些东西,不要会写。只要会粘!

    <body onselectstart="return false">   取消选取、防止复制
    <noscript><iframe src=*.html></iframe></noscript>  网页将不能被另存为
    <link rel="Shortcut Icon" href="favicon.ico">   IE地址栏前换成自己的图标
    <link rel="Bookmark" href="favicon.ico">     可以在收藏夹中显示出你的图标

    模仿IE
    <object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
    <param name="Command" value="Minimize"></object>
    <object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
    <param name="Command" value="Maximize"></object>
    <OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
    <PARAM NAME="Command" VALUE="Close"></OBJECT>
    <input type=button value=最小化 onclick=hh1.Click()>
    <input type=button value=最大化 onclick=hh2.Click()>
    <input type=button value=关闭 onclick=hh3.Click()>

    //前进后退的按钮
    <a href ="" onClick="parent.history.back(); return false;"
      onMouseOver="self.status='后退' ;return true;">
    [back]</a>
    <a href ="" onClick="parent.history.forward(); return false;"
      onMouseOver="self.status='前进'; return true;">
    [next]</a>

    HTML和服务器端的控件都可以用
    onpaste="return false"      不准粘贴
    oncopy="return false;" oncut="return false;"        防止复制
    <input style="ime-mode:disabled">    关闭输入法

    //禁止鼠标右键
    <script language=JavaScript>
    <!--
    var message="";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    document.oncontextmenu=new Function("return false")
    // -->
    </script>

    弹出窗口
    <a href="#" onclick='Javascript:window.open("test.aspx","newwin","height=200,width=400,top=500,left=500 ,status=yes,toolbar=no,menubar=no,location=no")'>无地址栏的窗口</a>

    禁止输入特殊字符正则表达试:
    ^(?:[\u4e00-\u9fa5]*\w*\s*)+$

    过虑非法字符的函数:
     public string CheckStr(string str)
      { 
       str = str.Replace("<", "&lt;");
       str = str.Replace(">", "&gt;");
       str = str.Replace("'", "''");
       str = str.Replace(" ", "&nbsp;");
       str = str.Replace("\n", "<br/>");
       str = str.Replace("\r\n", "<br/>");
       str = str.Trim();
       return str;
      }

  • 相关阅读:
    弹出层
    浅析.Net下的多线程编程
    网站新闻模块中应用装饰模式
    通过MVC模式将Web视图和逻辑代码分离
    得到任意网页源代码 (利用WebClient和WebRequest类)
    ASP.NET网站部署问题集
    什么是url重写
    C#基础概念二十五问(一)
    ASP.NET Memory:如果你的应用已经在生产环境中,那为什么还要debug=true
    Go Gob编码
  • 原文地址:https://www.cnblogs.com/mmmhhhlll/p/17988.html
Copyright © 2011-2022 走看看