网易邮盘操作FSO

fileinfo.asp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>显示文件描述</title>

<style type="text/css">

<!--

a.link{

color:black;

text-decoration:none;

}

a.hover{

color:green;

text-decoration:underline;

}

a.visited{

color:black;

text-decoration:none;

}

a.active{

color:black;

text-decoration:none;

}

-->

</style>

</head>

<body>

<%

set fso=server.createobject("scripting.filesystemobject")

set folder=fso.getfolder("e:victorfso")

for each file in folder.files

t1="Name:" & file.name

t2="File Size:" & file.size

t3="Created Date:" & file.datecreated

t4="Date LastModified:" & file.datelastmodified

t5="Description" & "&#13;" & "&nbsp;&nbsp;&nbsp;&nbsp;" & t1 &  "&#13;"  & "&nbsp;&nbsp;&nbsp;&nbsp;" & t2  & "&#13;" & "&nbsp;&nbsp;&nbsp;&nbsp;" & t3 &  "&#13;"  &  "&nbsp;&nbsp;&nbsp;&nbsp;" & t4

%>

<br>

<a href="#" title="<%=t5%>" ><%=file.name%></a>

<br>

<%response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & t1 &"<br>"

response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & t2 &"<br>"

response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & t3  &"<br>"

response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & t4

next

%>

<br />

</body>

</html>

move.asp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

</head>

<body>

<script>

function createfolder(){

var foldername=prompt("请输入要创建的文件夹名称:","")

if(foldername!=""){

location.href="createfolder.asp?foldername="+foldername

}

else{

alert("文件夹名称不能为空!")

}

}

function createtextfile(){

var filename=prompt("请输入要创建的文件名称:","")

if(filename!=""){

location.href="createtextfile.asp?filename="+filename

}

else{

alert("文件名称不能为空!")

}

}

function movefile(){

document.form1.action="movefile.asp"

document.form1.submit()

}

function CheckAll(chk) {

for (var i=0;i<chk.length;i++) chk[i].checked=true;

}

</script>

<script language=javascript>

function mm()

{

var a = document.getElementsByTagName("input");

if(a[0].checked==true){

for (var i=0; i<a.length; i++)

if (a[i].type == "checkbox") a[i].checked = false;

}

else

{

for (var i=0; i<a.length; i++)

if (a[i].type == "checkbox") a[i].checked = true;

}

}

function rename(){

var filename=prompt("请输入新名称:","")

if(filename!=""){

document.form1.action="rename.asp?filename="+filename

document.form1.submit();

}

else{

alert("名称不能为空!")

}

}

function del(){

var question=confirm("您确定要删除吗? 删除后将不能恢复!");

  if(question==true){

      var really=confirm("想好了吗?");

           if(really==true){

           document.form1.action="delete.asp"

           document.form1.submit();

                             }

           else{

            alert("孤疑犹豫,后必有悔!")

                }

                     }

   else{

   alert("您取消了删除操作!")

                       }

                  }

</script>

<form   method="post">

<%

set fso=server.CreateObject("scripting.filesystemobject")

set folder=fso.getfolder("E:victorfso")

for each folder in folder.subfolders

%>

<font color=red>

<%= folder.name %>

</font>

<br>

<%

for each file in folder.files

%>

 

&nbsp;&nbsp;<%= file.name%>

<br>

<%

next

next

%>

<br />

<%

set fso=server.CreateObject("scripting.filesystemobject")

set folder=fso.getfolder("E:victorfso")

for each file in folder.files

%>

<input type="checkbox" value="<%=file.name%>">

 <%=file.name %>

<br/>

<%

next

%>

全选<input type="checkbox" value="Check All">

<input type=button value="创建文件夹" />

<input type=button value="创建文本文件" />

<select style="color:#FF0000;">

<option value="0">请选择目标文件夹:</option>

<%

set fso=server.CreateObject("scripting.filesystemobject")

set folder=fso.getfolder("E:victorfso")

for each folder in folder.subfolders

%>

 <option value="<%=folder.name%>">&nbsp;&nbsp;&nbsp;&nbsp;<%=folder.name%></option>

<%

next

%>

</select>

<!--

<input type="submit" value="submit">

-->

<input type="button" value="改名"  />

<input type="button" value="删除"  />

</form>

</body>

</html>

createfolder.asp

<%

set fso=server.createobject("scripting.filesystemobject")

foldername=request("foldername")

if fso.folderexists(server.mappath(foldername)) then

%>

<script>

alert("该文件夹已经存在!")

</script>

<%

else

fso.createfolder(server.mappath(foldername))

%>

<script>

alert("创建成功!")

</script>

<%end if%>

<script>

location.href="move.asp"

</script>

createtextfile.asp

<%

set fso=server.createobject("scripting.filesystemobject")

filename=request("filename")

if fso.fileexists(server.mappath(filename)) then

%>

<script>

alert("该文件已经存在!")

</script>

<%

else

fso.createtextfile(server.mappath(filename))

%>

<script>

alert("创建成功!")

</script>

<%end if%>

<script>

location.href="move.asp"

</script>

delete.asp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

</head>

<body>

<%

selfilename=split(request("selfilename"),",")

set fso=server.CreateObject("scripting.filesystemobject")

for i=0 to ubound(selfilename)

fso.deletefile server.mappath(selfilename(i))

next

response.redirect("move.asp")

%>

</body>

</html>

rename.asp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

</head>

<body>

<%

set fso=server.CreateObject("scripting.filesystemobject")

'set file=fso.getfile("e:victorfsoinfo.html")

'fso.copyfile "e:victorfsoinfo.html","e:victorfsoinfo.asp"

'fso.deletefile "e:victorfsoinfo.html"

'response.write request("selfilename")

'response.write request("filename")

fso.copyfile server.mappath(request("selfilename")),server.mappath(request("filename"))

fso.deletefile server.mappath(request("selfilename"))

response.redirect("move.asp")

%>

</body>

</html>

movefile.asp

<%

set fso=server.CreateObject("scripting.filesystemobject")

filename=request("selfilename")

foldername=request("selfolder")

'fso.movefile "E:victorfso" & filename, "E:victorfso" & foldername & ""

'response.redirect "move.asp"

fname=split(filename,",")

for i=0 to ubound(fname)

'response.write fname(i)&"<br>"

'response.write "E:victorfso"&fname(i) &"<br>"

'response.write server.mappath(fname(i)) & "<br>"

fso.movefile server.mappath(fname(i)), server.mappath(foldername)&""    '"E:victorfso" & foldername & ""

'response.write server.mappath(foldername)&""

next

'response.write "E:victorfso"&foldername

response.Redirect("move.asp")

%>

    A+
发布日期:2007年03月28日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: