find.aspx
上传用户:lanchensha
上传日期:2022-02-27
资源大小:7530k
文件大小:4k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <%@ Page language="c#" AutoEventWireup="true" %>
  2. <%@ Import Namespace="DotNetTextBox" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" >
  5. <head>
  6. <title><%=ResourceManager.GetString("findfile")%></title>
  7. <meta http-equiv="pragma" content="no-cache" />
  8. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  9. <base target="_self" />
  10. <link href="stylesheet.css" rel="stylesheet" type="text/css" />
  11. </head>
  12. <script runat="server" language="C#">
  13. private void Page_Load(object sender, System.EventArgs e)
  14. {
  15.     if (!IsPostBack)
  16.     {
  17.         if (Request.Cookies["languages"] != null)
  18.         {
  19.             ResourceManager.SiteLanguageKey = Request.Cookies["languages"].Value;
  20.         }
  21.         else
  22.         {
  23.             ResourceManager.SiteLanguageKey = HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"].ToLower().Split(',')[0];
  24.         }
  25.     }
  26. }
  27. </script>
  28. <script language="JavaScript" type="text/javascript">
  29. var userAgent = navigator.userAgent.toLowerCase();
  30. var is_ie = (userAgent.indexOf('msie') != -1);
  31. if(is_ie)
  32. {
  33. var oSelection;
  34. oSelection = dialogArguments.document.body.createTextRange();
  35. }
  36. function searchtype(){
  37.     var retval = 0;
  38.     var matchcase = 0;
  39.     var matchword = 0;
  40.     if (document.frmSearch.blnMatchCase.checked) matchcase = 4;
  41.     if (document.frmSearch.blnMatchWord.checked) matchword = 2;
  42.     retval = matchcase + matchword;
  43.     return(retval);
  44. }
  45. function checkInput(){
  46.     if (document.frmSearch.strSearch.value.length < 1) {
  47.         alert('<%=ResourceManager.GetString("pleaseinput")%>');
  48.         return false;
  49.     } else {
  50.         return true;
  51.     }
  52. }
  53. oSelection.expand("textedit");
  54. oSelection.collapse();
  55. oSelection.select();
  56. function findtext(){
  57.     if (checkInput()) {
  58.         var searchval = document.frmSearch.strSearch.value;
  59.         oSelection.collapse(false);
  60.         if (oSelection.findText(searchval, 1000000000, searchtype())) {
  61.             oSelection.select();
  62.         } else {
  63.             var startfromtop = confirm('<%=ResourceManager.GetString("findfinal")%>');
  64.             if (startfromtop) {
  65.                 oSelection.expand("textedit");
  66.                 oSelection.collapse();
  67.                 oSelection.select();
  68.                 findtext();
  69.             }
  70.         }
  71.     }
  72. }
  73. window.focus();
  74. </script>
  75. <body>
  76.     <form id="frmSearch" runat="server"  class="alertbgc">
  77.     <div  class="alertbgc">
  78. <TABLE CELLSPACING="0" cellpadding="5" border="0"  class="alertbgc">
  79. <TR><TD VALIGN="top" align="left">
  80.     <label for="strSearch"><%=ResourceManager.GetString("findname")%></label><br>
  81.     <INPUT TYPE=TEXT SIZE=40 NAME=strSearch id="strSearch" style="width : 200px;"><br>
  82.     <INPUT TYPE=Checkbox SIZE=40 NAME=blnMatchCase ID="blnMatchCase"><label for="blnMatchCase"><%=ResourceManager.GetString("casesensitive")%></label><div id='matchword'><INPUT TYPE=Checkbox SIZE=40 NAME=blnMatchWord ID="blnMatchWord"><label for="blnMatchWord"><%=ResourceManager.GetString("wholeword")%></label></div>
  83. </td>
  84. <td rowspan="2" valign="top">
  85.     <input type=button style="width:80px;margin-top:15px" name="btnFind" onClick="findtext();" value='<%=ResourceManager.GetString("findnext")%>'><br />
  86.     <input type=button style="width:80px;margin-top:5px" name="btnCancel" onClick="window.close();" value='<%=ResourceManager.GetString("close")%>'><br>
  87. </td>
  88. </tr>
  89. </table>
  90.     </div>
  91.     </form>
  92. </body>
  93. <script language=javascript>
  94. if(is_ie)
  95. {
  96. document.body.bgColor="ButtonFace";
  97. }
  98. else
  99. {
  100. document.body.bgColor="#E0E0E0";
  101. }
  102. </script>
  103. </html>