注册 登录
编程论坛 ASP技术论坛

关于asp的一个问题

wghost 发布于 2009-11-07 21:21, 548 次点击
<html>
<head>
<title>练习</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body>
<%
  if request.querystring("query")<>"test" then
%>
  <form action="?query=test" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <input type="file" name="file">
  <input type="submit" name="submit" value="提交">
  </form>
<%
else
    response.contenttype="image/gif" '设置输出类型为图像
    data=request.binaryread(request.totalbytes) '获取客户端转送的所有数据
    tcrlf=chrb(13)&chrb(10) '回车符号代码
    flag=leftb(data,instrb(data,tcrlf)-1) '获取图像数据结构标志
    datastart=instrb(data,tcrlf& tcrlf)+4 '获取图像数据开始位置
   datalength=instrb(datastart+1,data,flag)-datastart'获取图像数据长度
   response.binarywrite midb(data,datastart,datalength) '输出图像
end if

%>

</body>
</html>
<html>
上面程序运行后出现下面代码,我是初学者,希望哪位高手可以给详细讲解下!!!




<head>
<title>练习</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body>
6 回复
#2
msgj2009-11-08 07:31
检查服务器上asp是否运行。
#3
chenbofeng202009-11-09 09:18
我曾经上传一个网站到一个空间后也出现这种问题,空间服务商的答复是“该空间不支持ASP”。我认为这个问题是IIS安装时有问题,所以你尝试重新安装下IIS.
#4
wghost2009-11-10 13:51
不会吧!其他asp程序是可以运行的
#5
chenbofeng202009-11-10 14:00
要不就是页面最上面少了句代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
#6
wghost2009-11-13 21:03
加了以后还一样啊!!
#7
yms1232009-11-14 18:43
<html>
<head>
<title>练习</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body>
<%
  if request.querystring("query")<>"test" then
%>
  <form action="?query=test" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <input type="file" name="file">
  <input type="submit" name="submit" value="提交">
  </form>
<%
else
    response.contenttype="image/gif" '设置输出类型为图像
    data=request.binaryread(request.totalbytes) '获取客户端转送的所有数据
    tcrlf=chrb(13)&chrb(10) '回车符号代码
    flag=leftb(data,instrb(data,tcrlf)-1) '获取图像数据结构标志
    datastart=instrb(data,tcrlf& tcrlf)+4 '获取图像数据开始位置
   datalength=instrb(datastart+1,data,flag)-datastart'获取图像数据长度
   response.binarywrite midb(data,datastart,datalength) '输出图像
end if

%>

</body>
</html>
<html>
这段程序主要解释的是上传图片或文件的实现原理,空间商如果不支持ASP是没有办法运行ASP代码的。
1