⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upsavepic.asp

📁 这是一个物流网站的源代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="CheckAdmin.asp"-->
<!--#include file="Config.asp"-->
<!--#include file="Navtree.asp"-->
<!--#include file="Conn.asp"-->
<!--#'include file="setting.asp"-->
<style type="text/css">
<!--
body {
	FONT-SIZE: 9pt; color:#FF0000;
	background-color: #f0f0f0;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;

}
.bt1 {  font-size: 9pt; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; height: 16px; width: 60px; background-color:#ffffff; cursor: hand}
-->
</style>
<%server.scripttimeout=9999%>
<!-- #include file="Upload.asp" -->
<script>parent.document.form1.Submit.disabled=false;</script>
<%

call upload_0()
sub upload_0()
dim upload,file,fpath,filename,fileext
set upload=new UpFile_Class '建立对像
n=10240  
sizes=n*1024
'300kb大小
upload.getdate(sizes)

if upload.err>0 then
select case upload.err
case 1
Response.Write "请先选择你要上传的文件 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
case 2
	Response.Write "文件大小超过了限制 "&n&"K [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
	
end select
exit sub

else

fpath=upload.form("filepath")
if right(fpath,1)<>"/" then fpath=fpath&"/"

for each formname in upload.file '列出上传的文件
set file=upload.file(formname) '生成文件对象
fileext=lcase(file.fileExt)

if fileext="asp" or fileext="aspx" or fileext="asa" then 
checkfileext(fileext)=false
end if

if checkfileext(fileext)=false then
response.write "格式不正确 <a href=# onclick=history.go(-1)>重新上传</a>"
response.end
end if

filesize=file.filesize
Sizes=formatnumber(file.filesize/1024,0)&"KB"
randomize
newname=year(now())&month(now())&day(now)&hour(now())&minute(now())&second(now())&left(clng((10000-1000+1)*rnd+1),4)
filename=newname&"."&file.fileExt
names=filename
filename=fpath&filename
if filesize>0 then
filename1=server.mappath(filename)
file.SaveToFile filename1
pic=upload.form("pic")

if lcase(fileext)= "jpg" or lcase(fileext)= "gif" then
	sql="select site_ying from settings"
	set rs_ying=conn.execute(sql)
	if not rs_ying.eof then
	xxx=split(rs_ying("site_ying"),",")
		if xxx(0)= 1 then
			Addying filename1,xxx(1),xxx(2),xxx(3),xxx(4),xxx(5),xxx(6),xxx(7),xxx(8),xxx(9),xxx(10)
		end if
	end if
end if

response.write "<script>parent.document.forms[0]."&upload.form("tup")&".value='"&names&"'</script>"
response.write "<script>parent.document.forms[0]."&upload.form("tup2")&".value='"&Sizes&"'</script>"
response.write "上传文件成功"
'response.end
end if

set file=nothing
next
end if
end sub

function checkfileext(fileext)

fileext=replace(lcase(fileext),".",",")
filepic=".gif.jpg.png.bmp.jpeg.rar.zip.exe.doc.xls.chm.hlp.pdf.swf"
filepic2=split(filepic,".")
for i=0 to ubound(filepic2)
if fileext=trim(filepic2(i)) then
checkfileext=true
exit function
else
checkfileext=false
end if
next
end function
function Addying(path,types,wenzi,tupian,color,touming,weizhi,ziti,daxiao,color2,bolds)
	color=replace(color,"#","")
	color2=replace(color2,"#","")
''//生成水印
	'Dim Jpeg,Logo
	Set Jpeg = Server.CreateObject("Persits.Jpeg")
	Set Logo = Server.CreateObject("Persits.Jpeg")
	Jpeg.Open Path
	if types=0 then
		IF bolds="True" then
			bolds=true
		else
			bolds=false
		end if
		Jpeg.Canvas.Font.Color= "&H"&color2
		Jpeg.Canvas.Font.Family = ziti
		Jpeg.Canvas.Font.Bold = bolds
		Jpeg.Canvas.Font.Size = daxiao
		lens=len(wenzi)*daxiao/2
		'lens2=len(wenzi)
		if weizhi = 0 then
			Jpeg.Canvas.Print Jpeg.Width/2,Jpeg.height/2,wenzi
		elseif weizhi = 1 then
			Jpeg.Canvas.Print 0,0,b/100, wenzi
		elseif weizhi = 2 then
			Jpeg.Canvas.Print 0,Jpeg.height-daxiao, wenzi
		elseif weizhi = 3 then
			Jpeg.Canvas.Print Jpeg.Width-lens,0, wenzi
		elseif weizhi = 4 then
			Jpeg.Canvas.Print Jpeg.Width-lens,Jpeg.height-daxiao, wenzi
		end if
		'Jpeg.Canvas.Print 10, 10, wenzi
		'Jpeg.Canvas.Pen.Color=color2
		'Jpeg.Canvas.Pen.Width=1
		'Jpeg.Canvas.Brush.Solid = False
		'Jpeg.Canvas.Bar 1, 1, Jpeg.Width, Jpeg.Height
	else
		''//图片
		
		LogoPath = Server.MapPath(tupian)
		Logo.Open LogoPath
		if weizhi = 0 then
			Jpeg.DrawImage Jpeg.Width/2-Logo.Width/2,Jpeg.height/2-logo.height/2, Logo ,touming/100,"&H"&color
		elseif weizhi = 1 then
			Jpeg.DrawImage 0,0, Logo ,b/100,"&H"&color
		elseif weizhi = 2 then
			Jpeg.DrawImage 0,Jpeg.height-logo.height, Logo ,touming/100,"&H"&color
		elseif weizhi = 3 then
			Jpeg.DrawImage Jpeg.Width-Logo.Width,0, Logo ,touming/100,"&H"&color
		elseif weizhi = 4 then
			Jpeg.DrawImage Jpeg.Width-Logo.Width,Jpeg.height-logo.height, Logo ,touming/100,"&H"&color
		end if
	end if
	Jpeg.Save Path
	Set Jpeg = Nothing
	Set Logo = Nothing   	
end function
%>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -