Templets_AddFolder.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:3k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_Inc/Function.asp" -->
  5. <!--#include file="../FS_Inc/Cls_Cache.asp" -->
  6. <%
  7. Dim Conn
  8. MF_Default_Conn
  9. MF_Session_TF
  10. Dim Path,AddPath,Action,sRootDir
  11. if SysRootDir<>"" then sRootDir="/" & SysRootDir else sRootDir=""
  12. Path = Request("Path")
  13. AddPath = Request("AddPath")
  14. Action = Request("Action")
  15. %>
  16. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  17. <html>
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  20. <title></title>
  21. </head>
  22. <link href="../../CSS/ModeWindow.css" rel="stylesheet">
  23. <body topmargin="0" leftmargin="0" scroll=no>
  24. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  25.   <form action="" method="post" name="Form">
  26.   <tr> 
  27.     <td height="36" colspan="2"> 
  28.       <div align="center">栏目名称
  29.         <input type="text" onFocus="CheckErrorChar();" onBlur="CheckErrorChar();" name="AddPath" value="<% = AddPath %>">
  30.       </div></td>
  31.   </tr>
  32.   <tr> 
  33.     <td height="26">
  34. <div align="center">
  35.         <input type="submit" name="Submit" value=" 确 定 ">
  36.           <input name="Action" type="hidden" id="Action" value="Submit">
  37.           <input name="ParentPath" type="hidden" value="<% = Path %>" id="ParentPath">
  38.         </div></td>
  39.     <td height="26">
  40. <div align="center">
  41.         <input type="button" onClick="window.close();" name="Submit2" value=" 取 消 ">
  42.       </div></td>
  43.   </tr>
  44.  </form>
  45. </table>
  46. </body>
  47. </html>
  48. <script language="JavaScript">
  49. document.Form.AddPath.focus();
  50. function CheckErrorChar()
  51. {
  52. var TempStr=document.Form.AddPath.value,AlertStr='';
  53. var ErrorCharArray=new Array(''','"','*');
  54. var re=null;
  55. for (var i=0;i<ErrorCharArray.length;i++)
  56. {
  57. if (TempStr.indexOf(ErrorCharArray[i])!=-1)
  58. {
  59. AlertStr+=ErrorCharArray[i];
  60. re=new RegExp('['+ErrorCharArray[i]+']?','ig');
  61. document.Form.AddPath.value=document.Form.AddPath.value.replace(re,'');
  62. }
  63. }
  64. if (AlertStr!='') alert('发现非法字符'+AlertStr);
  65. }
  66. </script>
  67. <%
  68. if Action = "Submit" then
  69. Dim FsoObj,PhysicalPath,ResponseStr
  70. if Path <> "" and AddPath <> "" then
  71. if Path = sRootDir &"/" then
  72. PhysicalPath = Server.MapPath(Path & AddPath)
  73. else
  74. PhysicalPath = Server.MapPath(Path & "/" & AddPath)
  75. end if
  76. Set FsoObj = Server.CreateObject(G_FS_FSO)
  77. if FsoObj.FolderExists(PhysicalPath) = True then
  78. ResponseStr = "目录已经存在"
  79. else
  80. FsoObj.CreateFolder PhysicalPath
  81. end if
  82. Set FsoObj = Nothing
  83. end if
  84. if ResponseStr <> "" then
  85. %>
  86. <script language="JavaScript">alert('<% = ResponseStr %>');document.Form.AddPath.select();</script>
  87. <%
  88. else
  89. %>
  90. <script language="JavaScript">dialogArguments.location.reload();window.close();</script>
  91. <%
  92. end if
  93. end if
  94. %>