重命名文件 [英] Rename a file

查看:75
本文介绍了重命名文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,有一个重命名文件的问题;还不知道

错误在哪里。

这是代码:

<%

''*********************************************** ** **************************

*

file_orig = session(" ; nome_file")

file_copy = session(" id_risp")& " _" &安培; session(" id_recl")

''path_copy = Server.Mappath(" / document /"& file_copy&" .doc")


''response.write(file_orig)&"< br>"

''response.write(file_copy)&"< br>"

''response.end


Dim fso

set fso = Server.CreateObject(" Scripting.FileSystemObject")

fso.MoveFile file_orig,file_copy< - (ROW:117)

set fso = nothing

%>

这是错误:


Microsoft VBScript运行时错误''800a0035''


找不到文件


/aaaa/bbbb/zzzz/frm_risp_new_sql.asp,第117行

你有什么线索吗?

Hello, got a prob with renaming a file; still don''t know where is the
mistake.
this is the code:
<%
''************************************************* **************************
*
file_orig=session("nome_file")
file_copy=session("id_risp") & "_" & session("id_recl")
''path_copy=Server.Mappath("/document/" & file_copy & ".doc")

''response.write(file_orig)&"<br>"
''response.write(file_copy)&"<br>"
''response.end

Dim fso
set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.MoveFile file_orig, file_copy <--( ROW: 117 )
set fso = nothing
%>
and this is the Error :

Microsoft VBScript runtime error ''800a0035''

File not found

/aaaa/bbbb/zzzz/frm_risp_new_sql.asp, line 117

Have u got any clue?

推荐答案

file_orig和file_copy的值是什么,file_orig是否存在?

path_copy的目的是什么?为什么它被注释掉?


Paul


" tom" < TG *** @ libero.it>在留言中写道

新闻:Ou ************** @ TK2MSFTNGP10.phx.gbl ...
What are the values of file_orig and file_copy and does file_orig exist?

What is the intended purpose of path_copy and why is it commented out?

Paul

"tom" <tg***@libero.it> wrote in message
news:Ou**************@TK2MSFTNGP10.phx.gbl...
你好,得到了一个问题重命名文件;还不知道
错误在哪里。
这是代码:
<%

''********* **************************************** ********** **************** *
file_orig = session(" nome_file")
file_copy = session(" id_risp")& " _" &安培; session(" id_recl")
''path_copy = Server.Mappath(" / document /"& file_copy&" .doc")

''response.write (file_orig)&"< br>"
''response.write(file_copy)&"< br>"
''response.end

Dim fso
set fso = Server.CreateObject(" Scripting.FileSystemObject")
fso.MoveFile file_orig,file_copy< - (ROW:117)
set fso = nothing
%>

这是错误:

Microsoft VBScript运行时错误''800a0035''

找不到文件

/aaaa/bbbb/zzzz/frm_risp_new_sql.asp,第117行

你有什么线索吗?
Hello, got a prob with renaming a file; still don''t know where is the
mistake.
this is the code:
<%
''************************************************* ************************** *
file_orig=session("nome_file")
file_copy=session("id_risp") & "_" & session("id_recl")
''path_copy=Server.Mappath("/document/" & file_copy & ".doc")

''response.write(file_orig)&"<br>"
''response.write(file_copy)&"<br>"
''response.end

Dim fso
set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.MoveFile file_orig, file_copy <--( ROW: 117 )
set fso = nothing
%>
and this is the Error :

Microsoft VBScript runtime error ''800a0035''

File not found

/aaaa/bbbb/zzzz/frm_risp_new_sql.asp, line 117

Have u got any clue?


< br>

tom写道:
你好,有一个重命名文件的问题;还不知道
错误在哪里。
这是代码:
<%

''********* **************************************** ********** **************** *
file_orig = session(" nome_file")
file_copy = session(" id_risp")& " _" &安培; session(" id_recl")
''path_copy = Server.Mappath(" / document /"& file_copy&" .doc")

''response.write (file_orig)&"< br>"
''response.write(file_copy)&"< br>"
''response.end

Dim fso
set fso = Server.CreateObject(" Scripting.FileSystemObject")
fso.MoveFile file_orig,file_copy< - (ROW:117)
set fso = nothing
%>

这是错误:

Microsoft VBScript运行时错误''800a0035''

找不到文件

/aaaa/bbbb/zzzz/frm_risp_new_sql.asp,第117行

你有任何线索吗?
Hello, got a prob with renaming a file; still don''t know where is the
mistake.
this is the code:
<%
''************************************************* ************************** *
file_orig=session("nome_file")
file_copy=session("id_risp") & "_" & session("id_recl")
''path_copy=Server.Mappath("/document/" & file_copy & ".doc")

''response.write(file_orig)&"<br>"
''response.write(file_copy)&"<br>"
''response.end

Dim fso
set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.MoveFile file_orig, file_copy <--( ROW: 117 )
set fso = nothing
%>
and this is the Error :

Microsoft VBScript runtime error ''800a0035''

File not found

/aaaa/bbbb/zzzz/frm_risp_new_sql.asp, line 117

Have u got any clue?




我的猜:确保你正在寻找合适的文件。我看到你有一些

response.writes注释掉了。您是否已验证正确的路径和

文件是否存储在file_orig中?如果是这样,用户帐户是否有足够的文件系统权限?


Bob Barrows


-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。我的From

标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。



My guess: make sure you''re looking for the right file. I see you have some
response.writes commented out. Have you verified that the correct path and
file are being stored in file_orig? If so, does the user account have
sufficient file system permissions for this file?

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don''t check it very often. You will get a
quicker response by posting to the newsgroup.


那么,您可以取消注释并告诉我们结果吗?你确认文件存在了吗?
Well, can you uncomment this and tell us the results? Have you verified
that the file exists?
''response.write(file_orig)&"< br>"
''response.write(file_orig)&"<br>"




您也可以使用FileExists方法,例如


如果不是fso.FileExists(file_orig)那么

response.write无法找到 &安培; file_orig

其他

''...用文件做东西...

结束如果


-
http://www.aspfaq.com/

(反向回复地址。)



You can also use the FileExists method, e.g.

if not fso.FileExists(file_orig) then
response.write "Couldn''t find " & file_orig
else
'' ... do stuff with file ...
end if

--
http://www.aspfaq.com/
(Reverse address to reply.)


这篇关于重命名文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆