ASP 爱好者进。。。。。急啊。。。
- 提问者网友:自食苦果
- 2021-07-19 00:29
<%
yuanwjj=request.Form("ywjj")
yuanwjm=replace(request.form("ywjm"),".","")
yuanhzm=request.form("yhzm")
muwjj=request.form("mwjj")
muwjm=replace(request.form("mwjm"),".","")
muhzm=request.form("mhzm")
folder1=server.MapPath(yuanwjj)
folder2=server.MapPath(muwjj)
set myFso=server.CreateObject("Scripting.FileSystemObject")
if myFso.fileExists(folder1&"\"&yuanwjm&"."&yuanhzm) then
'myFso.copyfile server.MapPath(yuanwjj)&"\"&yuanwjm&"."&yuanhzm ,server.MapPath(muwjj)&"\",true
myFso.copyfile folder1&"\"&yuanwjm&"."&yuanhzm ,folder2&"\",true
else
response.write("源文件不存在")
end if
set myFso=nothing
%>
<form action="" method="post" name="form1" id="form1">
<p> </p>请选择你要拷贝的源文件:
<label>
<select name="ywjj" id="ywjj">
<option>a1</option>
<option>newFile</option>
</select>
</label>
\
<label>
<input name="ywjm" type="text" id="ywjm" size="10" />
</label>
.
<label>
<input name="yhzm" type="text" id="yhzm" size="6" />
</label>
<p> 请选择要拷贝的目标文件:
<label>
<select name="mwjj" id="mwjj">
<option>a1</option>
<option>newFile</option>
</select>
</label>
\
<label>
<input name="mwjm" type="text" id="mwjm" size="10" />
</label>
.
<label>
<input name="mhzm" type="text" id="mhzm" size="6" />
</label>
</p>
<p>
<label>
<input type="submit" name="Submit2" value="提交" onclick=""/>
</label>
</p>
</form>
</body>
- 五星知识达人网友:一秋
- 2021-07-19 01:59
文件夹没有值啊?
我改了,你试试看
<body>
<%
yuanwjj=request.Form("ywjj")
yuanwjm=replace(request.form("ywjm"),".","")
yuanhzm=request.form("yhzm")
muwjj=request.form("mwjj")
muwjm=replace(request.form("mwjm"),".","")
muhzm=request.form("mhzm")
folder1=server.MapPath(yuanwjj)
folder2=server.MapPath(muwjj)
set myFso=server.CreateObject("Scripting.FileSystemObject")
if myFso.fileExists(folder1&"\"&yuanwjm&"."&yuanhzm) then
'myFso.copyfile server.MapPath(yuanwjj)&"\"&yuanwjm&"."&yuanhzm ,server.MapPath(muwjj)&"\",true
myFso.copyfile folder1&"\"&yuanwjm&"."&yuanhzm ,folder2&"\",true
else
response.write("源文件不存在")
end if
set myFso=nothing
%>
<form action="" method="post" name="form1" id="form1">
<p> </p>请选择你要拷贝的源文件:
<label>
<select name="ywjj" id="ywjj">
<option value="a1">a1</option>
<option value="newFile">newFile</option>
</select>
</label>
\
<label>
<input name="ywjm" type="text" id="ywjm" size="10" />
</label>
.
<label>
<input name="yhzm" type="text" id="yhzm" size="6" />
</label>
<p> 请选择要拷贝的目标文件:
<label>
<select name="mwjj" id="mwjj">
<option value="a1">a1</option>
<option value="newFile">newFile</option>
</select>
</label>
\
<label>
<input name="mwjm" type="text" id="mwjm" size="10" />
</label>
.
<label>
<input name="mhzm" type="text" id="mhzm" size="6" />
</label>
</p>
<p>
<label>
<input type="submit" name="Submit2" value="提交" onclick=""/>
</label>
</p>
</form>
</body>