时间转换和文件上传

YaYiYaO 2005-09-15 09:33:37
1、如何将时间类型转换成:2005091521324466
2、在上传文件时,如何控制文件的大小?下面的代码哪里错了?
<%
if Request.TotalBytes >= 1024 * 1024 then
response.write("<script language='javascript'>")
response.write("alert('图片太大!');")
response.write("history.back();")
response.write("</script>")
response.end
end if
%>
...全文
126 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
YaYiYaO 2005-09-19
  • 打赏
  • 举报
回复
up!!
YaYiYaO 2005-09-16
  • 打赏
  • 举报
回复
asp中没有直接转换的函数吗,像什么datetoint,datetostr,timetoint只类的吗
而且我不认为后面的是随机数,应该是精确到毫秒是数值
tigerwen01 2005-09-16
  • 打赏
  • 举报
回复
时间转换函数,后面的随即数楼主自己添加。
function chan_data(shijian)
s_year=year(shijian)
if len(s_year)=2 then s_year="20"&s_year
s_month=month(shijian)
if s_month<10 then s_month="0"&s_month
s_day=day(shijian)
if s_day<10 then s_day="0"&s_day
chan_data=s_year & s_month & s_day
end function
YaYiYaO 2005-09-16
  • 打赏
  • 举报
回复
up!
YaYiYaO 2005-09-16
  • 打赏
  • 举报
回复
up!!
YaYiYaO 2005-09-16
  • 打赏
  • 举报
回复
不是的,根本没用到数据库
纯粹是asp语句中的时间转换问题
Clove 2005-09-16
  • 打赏
  • 举报
回复
时间的话楼上的方法就可以,但是就是直接在数据库重处理了
如果判断文件大小的话看你的代码没发现啥问题
不知道你怎么处理的
rainxiang 2005-09-16
  • 打赏
  • 举报
回复
那应该是 sql里就转掉了比如

select replace(replace(replace(CONVERT(varchar(20),getdate(),120),'-',''),':',''),' ','')

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧