当前位置: 移动技术网 > IT编程>开发语言>.net > 无组件图文混合上传示例

无组件图文混合上传示例

2019年01月13日  | 移动技术网IT编程  | 我要评论

小燕子古筝简谱,tom星座,丽江打人

以下代码没有规范,还有些功能没完成,有那位高手能把它修改一下,封装成类则更是造福大众,或者以后有时间我会做的。有任何错误或建议请一定要给我发e-mail:sobina@21cn.com,谢谢。
  好了,少说多做,本示例在w2kserver,iis5,sql server(windows平台上强大的平台)7中测试通过。
如有不明白的可到精华区查“图象”或“图片”关键字找到答案,或写信给我。
  示例一共有三个文件:upload.htm(上传界面)
process.(处理程序)
showimg.asp(显示图象)
数据库:在pubs数据库中建立一个新表名为imgtest
字段名    类型   长度
----------------------------------------------
id int (自动编号)
img iamge
imginfo nchar 50

以下是三个文件的代码:

upload.htm
---------------------------------------------------------------------
<html>
<head>
<title>untitled document</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
.tx { height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px;

border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt;

background-color: #eeeeee; color: #0000ff}
.bt { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px;

border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 20px; width: 30px; font-size: 9pt; border: 1px solid; border-color: black black

#000000; color: #0000ff}
-->
</style>
</head>

<body bgcolor="#ffffff" text="#000000">
<form name="form1" method="post" action="process.asp" enctype="multipart/form-data" >
<table width="71%" border="1" cellspacing="0" cellpadding="5" align="center"

bordercolordark="#cccccc" bordercolorlight="#000000">
<tr bgcolor="#cccccc">
<td height="22" align="left" valign="middle" bgcolor="#cccccc"> sobina
的图文上传界面</td>
</tr>
<tr align="left" valign="middle" bgcolor="#eeeeee">
<td bgcolor="#eeeeee"> <br>
</td>
</tr>
<tr align="center" valign="middle">
<td align="left" id="upid" height="122">
<p>图象路径:
<input type="file" name="img" style="width:400" class="tx1" value="">
</p>
<p>图象说明:
<input type="text" name="imginfo">
</p>
</td>
</tr>
<tr align="center" valign="middle" bgcolor="#eeeeee">
<td bgcolor="#eeeeee" height="2">
<input type="submit" name="submit" value="· 提交 ·" class="bt">
<input type="reset" name="submit2" value="· 重置 ·" class="bt">
</td>
</tr>
</table>
</form>
</body>
</html>
------------------------------------------------------------------------
process.asp
------------------------------------------------------------------------
<!--#include file="../bin/strcnn.asp"-->
<%
response.expires=0
目的:将二进制字符转换成普通字符
function bin2str(binstr)
dim varlen,clow,ccc,skipflag
skipflag=0
ccc = ""
varlen=lenb(binstr)
for i=1 to varlen
if skipflag=0 then
clow = midb(binstr,i,1)
if ascb(clow) > 127 then
ccc =ccc & chr(ascw(midb(binstr,i+1,1) & clow))
skipflag=1

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网