日期:2014-05-17  浏览次数:20853 次

我又有问题啦!急啊!快点进来
这段代码如果用户上传图片的话不会出错,但是要是用户不上传图片的话他就会出错,出错的原因是增加水印的那段代码没有找到图片
我知道该判断img等于空的话就不执行那段增加水印的代码,但是不会写啊
麻烦大家帮我写下,应该很简单吧   以下是代码
==================================
<!--#Include   File= "../Inc/Conn.asp "-->
<!--#Include   File= "meminfonum.asp "-->

<%
Set   myrequest=new   UpLoadClass
        myrequest.open
img=session( "fname ")
If   img= " "   Then   img= "wu "
formid=myrequest.Form( "formid ")
lei=myrequest.Form( "lei ")
title=myrequest.Form( "title ")
guige=myrequest.Form( "guige ")
If   guige= " "   Then   guige= "wu "
shuliang=stripHTML(myrequest.Form( "shuliang "))
If   shuliang= " "   Then   shuliang= "wu "
jiage=stripHTML(myrequest.Form( "jiage "))
If   jiage= " "   Then   jiage= "wu "
shuoming=stripHTML(myrequest.Form( "shuoming "))

set   cmd   =   server.CreateObject( "adodb.command ")
cmd.activeconnection   =   conn
cmd.commandtype=4
cmd.commandtext= "checkJX_save "
cmd.prepared   =   true
cmd.parameters.append   cmd.createparameter( "sid ",3,1,4,CInt(Session( "Loginid ")))
cmd.parameters.append   cmd.createparameter( "tol ",3,1,4,intMemberInfoNum)
cmd.parameters.append   cmd.createparameter( "lei ",200,1,50,lei)
cmd.parameters.append   cmd.createparameter( "title ",200,1,50,title)
cmd.parameters.append   cmd.createparameter( "guige ",200,1,50,guige)
cmd.parameters.append   cmd.createparameter( "shuliang ",200,1,50,shuliang)
cmd.parameters.append   cmd.createparameter( "jiage ",200,1,50,jiage)
cmd.parameters.append   cmd.createparameter( "img ",200,1,200,img)
cmd.parameters.append   cmd.createparameter( "shuoming ",200,1,4000,shuoming)
cmd.parameters.append   cmd.createparameter( "riqi ",200,1,20,now())
cmd.parameters.append   cmd.createparameter( "ok ",3,2,4)
cmd.execute

if   cmd( "ok ")=0   then
response.Write( " <script> alert( '操作失败:\n\n今天该类信息添加和更新的总条数已经为 "&intMemberInfoNum& "条。\n\n您不能再添加或更新该类信息。 ');location.href= '../Fuwu_manage.asp?gaoji=jxx ' </script> ")
response.end
end   if

set   cmd   =   nothing
Conn.close   :   Set   Conn   =   Nothing
session( "fname ")= " "

Set   Jpeg   =   Server.CreateObject( "Persits.Jpeg ")  
Jpeg.Open   Server.MapPath( "../Uploadcoimg/ "&img& " ")
'开始写文字  
Jpeg.Canvas.Font.Color   =   &000000 ' '   red   颜色  
Jpeg.Canvas.Font.Family   =   "Courier   New "   '字体  
Jpeg.Canvas.Font.Bold   =   True   '是否加粗  
Jpeg.Canvas.Print   10,   10,   "www.bzjw.com. "  
'打印坐标x   打印坐标y   需要打印的字符  
'以下是对图片进行边框处理  
Jpeg.Canvas.Pen.Color   =   &H000000 ' '   black   颜色  
Jpeg.Canvas.Pen.Width   =   2   '画笔宽度  
Jpeg.Canvas.Brush.Solid   =   False   '是否加粗处理 &