C
caoran
Unregistered / Unconfirmed
GUEST, unregistred user!
try catch finally 如何使用?
各位好
大家看看这段代码中的"try catch"用法有什么错误?为什么每次执行,不管是否错误,都执行了error.aspx?请指教,谢谢!
<script language="vb" runat="server">
sub page_load(source as object, e as eventargs)
dim action,logip as string
action = request("action")
logip = request("ip")
if action="login" then
dim logname,logpwd as string
logname=session("name")
logpwd=session("pwd")
try
'response.write("ftp://" &
logname &
":" &
logpwd &
"@" &
logip)
response.redirect("ftp://" &
logname &
":" &
logpwd &
"@" &
logip)
catch
response.redirect("error.aspx")
response.end
end try
end if
end sub
</script>
各位好
大家看看这段代码中的"try catch"用法有什么错误?为什么每次执行,不管是否错误,都执行了error.aspx?请指教,谢谢!
<script language="vb" runat="server">
sub page_load(source as object, e as eventargs)
dim action,logip as string
action = request("action")
logip = request("ip")
if action="login" then
dim logname,logpwd as string
logname=session("name")
logpwd=session("pwd")
try
'response.write("ftp://" &
logname &
":" &
logpwd &
"@" &
logip)
response.redirect("ftp://" &
logname &
":" &
logpwd &
"@" &
logip)
catch
response.redirect("error.aspx")
response.end
end try
end if
end sub
</script>