| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 819 人关注过本帖
标题:错误的参数个数或无效的参数属性值
只看楼主 加入收藏
srom
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-5-21
收藏
 问题点数:0 回复次数:0 
错误的参数个数或无效的参数属性值
一个asp圈子程序,在主题下回复点确定提交,出现如下错误:

Microsoft VBScript 运行时错误 错误 '800a01c2'

错误的参数个数或无效的参数属性值: 'SendMail'

/quanzi/AddPost.asp,行 117

-----------------------------------------------------------
我不太懂asp,请各位老兄出手帮助一下呀
你可以到这个地址亲自试一下,http://

下面是AddPost.asp页面代码:

<!-- #include file="Setup.asp" -->
<%
HtmlTop

if CookieUserName=empty then error("您还未<a href=Login.asp?ReturnUrl="&ReturnUrl&">登录</a>")


    Rs.Open "select * from [Wo_Users] where UserID="&CookieUserID&"",Conn,1,3
    UserAccountStatus=Rs("UserAccountStatus")
    UserRegisterTime=Rs("UserRegisterTime")
    UserPostTime=Rs("UserPostTime")
    Rs.close

    if UserAccountStatus<>1 then error("您的帐号未通过审核!")
    
    if SiteConfig("RegUserTimePost") > 0 then
        StopPostTime=int(DateDiff("n",UserRegisterTime,Now()))
        if StopPostTime < SiteConfig("RegUserTimePost") then error("<li>新注册圈友必须等待 "&SiteConfig

("RegUserTimePost")&" 分钟后才能发表主题!<li>您必须再等待 "&SiteConfig("RegUserTimePost")-StopPostTime&" 分钟!")
    end if

    if SiteConfig("PostInterval") > 0 then
        StopPostTime=int(DateDiff("s",UserPostTime,Now()))
        if StopPostTime < SiteConfig("PostInterval") then error("群组限制一个人两次发表主题间隔必须大于 "&SiteConfig

("PostInterval")&" 秒!<li>您必须再等待 "&SiteConfig("PostInterval")-StopPostTime&" 秒!")
    end if

ThreadID=RequestInt("ThreadID")
PostID=RequestInt("PostID")


sql="Select * From [Wo_Threads] where ThreadID="&ThreadID&""
Rs.Open sql,Conn,1
    if Rs.Eof then error("系统不存在此主题的资料")
    if Rs("IsDel")=1 then error("此主题已经删除,不接受新的回复")
    if Rs("IsLocked")=1 then error("此主题已经关闭,不接受新的回复")
    ForumID=Rs("ForumID")
    PostsTableName=Rs("PostsTableName")
    Topic=Rs("Topic")
    Tags=Rs("Tags")
    
    PostAuthor=Rs("PostAuthor")
Rs.close

if Conn.Execute("select PostID from [Wo_Posts"&PostsTableName&"] where ThreadID="&ThreadID&" and PostID="&PostID&"").Eof then

error("系统没有找到回复主题ID")

sql="select * from [Wo_Forums] where ForumID="&ForumID&""
Set Rs=Conn.Execute(sql)
    ForumName=Rs("ForumName")
    Moderated=Rs("Moderated")
    ParentID=Rs("ParentID")
    GroupID=Rs("GroupID")
    ForumUrl=Rs("ForumUrl")
    IsActive=Rs("IsActive")
Rs.close

%>
<!-- #include file="Utility/ForumPermissions.asp" -->
<%
if ForumUrl<>"" then response.redirect ForumUrl
if IsActive=0 and PermissionManage=0 then error"<li>该版块已经关闭!"

if PermissionReply=0 then error("您的<a href=ShowForumPermissions.asp?ForumID="&ForumID&">权限</a>不够")

if Request.ServerVariables("Request_method") = "POST" then
    if Request.Form=Application("LastPost") and SiteConfig("AllowDuplicatePosts")=0 then error("请不要提交重复数据")

    Subject=HTMLEncode(Request.Form("PostSubject"))
    Body=BodyEncode(Request.Form("Body"))
    TagsPost=HTMLEncode(Request.Form("Tags"))
    
    if Tags="" then
            Tags=TagsPost
    else
            TagArray=split(TagsPost,",")
            for i=0 to ubound(TagArray)
                if instr(","&Tags&",",","&TagArray(i)&",")<1 then Tags=Tags&","&TagArray(i)
            next
    end if
    Tags=Left(Tags,255)

    
    if Request.Form("DisableYBBCode")<>1 then Body=YbbEncode(Body)
    if Len(Body)<2 then Message=Message&"<li>文章内容不能小于 2 字符"
    if Message<>"" then error(""&Message&"")


    Conn.Execute("update [Wo_Users] set

TotalPosts=TotalPosts+1,UserMoney=UserMoney+1,experience=experience+1,UserPostTime="&SqlNowString&" where

UserID="&CookieUserID&"")
    if Request.Form("UpFileID")<>"" then
        UpFileID=split(Request.Form("UpFileID"),",")
        for i = 0 to ubound(UpFileID)-1
            Conn.execute("update [Wo_PostAttachments] set Description='"&Subject&"' where UpFileID="&int

(UpFileID(i))&" and UserName='"&CookieUserName&"'")
        next
    end if
    
    UpdateStatistics 0,0,1
    Conn.Execute("insert into [Wo_Posts"&PostsTableName&"] (ThreadID,ParentID,PostAuthor,Subject,Body,IPAddress) values

('"&ThreadID&"','"&PostID&"','"&CookieUserName&"','"&Subject&"','"&Body&"','"&Request.ServerVariables("REMOTE_ADDR")&"')")
    Conn.execute("update [Wo_Threads] set

lastname='"&CookieUserName&"',Tags='"&Tags&"',TotalReplies=TotalReplies+1,lasttime="&SqlNowString&" where

ThreadID="&ThreadID&"")
    Conn.execute("update [Wo_Forums] set

MostRecentPostSubject='"&Topic&"',MostRecentPostAuthor='"&CookieUserName&"',MostRecentPostDate="&SqlNowString&",TodayPosts=To

dayPosts+1,TotalPosts=TotalPosts+1,MostRecentThreadID="&ThreadID&" where ForumID="&ForumID&" or ForumID="&ParentID&"")

    Application("LastPost")=Request.Form

if SiteConfig("SelectMailMode")<>"" then
    MailSubject="("&SiteConfig("SiteName")&")您订阅的主题有新回复"
    MailBody=MailBody&"主题:"&Topic&"<br>"
    MailBody=MailBody&"<a target=wh href="&SiteURL&"ShowPost.asp?ThreadID="&ThreadID&">"&SiteURL&"ShowPost.asp?

ThreadID="&ThreadID&"</a><br><br>"
    MailBody=MailBody&""&CookieUserName&" 发表于 "&now()&"<br>"
    MailBody=MailBody&"--------------------------------------------------------<br>"
    MailBody=MailBody&"<b>"&Subject&"</b><br>"&Body&"<br>--------------------------------------------------------

<br><br>"
    MailBody=MailBody&"您已通过邮件订阅了该主题,因此当主题有新主题您都将收到邮件通知。<br>"
    MailBody=MailBody&"如果您要取消邮件订阅,点击以上链接,选择“取消订阅”即可。<br>"
    
    set Rs=Conn.Execute("select top 100 * from [Wo_Subscriptions] where ThreadID="&ThreadID&" order by SubscriptionID")
    do while not Rs.eof
            MailAddRecipient=""&Rs("UserName")&"<"&Rs("Email")&">;"&MailAddRecipient
        Rs.movenext
    loop
    Rs.close
    SendMail MailAddRecipient,MailSubject,MailBody  这就是出现错误的117行
end if


    Message=Message&"<li>回复主题成功<li><a href=ShowPost.asp?ThreadID="&ThreadID&">返回主题</a><li><a

href=ShowForum.asp?ForumID="&ForumID&">返回群组</a>"
    succeed Message,"ShowForum.asp?ForumID="&ForumID&""
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    sql="select * from [Wo_Posts"&PostsTableName&"] where PostID="&PostID&""
    Set Rs=Conn.Execute(sql)
        ReBody="<table width=900 cellspacing=1 cellpadding=0 id=CommonListArea>"
        ReBody=ReBody&"<tr id=CommonListTitle><td colspan=2><span id=RePostAuthor>"&Rs("PostAuthor")&"</span> 发表于

:"&Rs("PostDate")&"</td></tr>"
        ReBody=ReBody&"<tr id=CommonListCell><td><span id=ReBody>"&Rs("Body")&"</span><br><br>"
        ReBody=ReBody&"<a class='CommonImageTextButton' style='BACKGROUND-IMAGE:url(images/Quote.gif)' title='引用回

复这个主题' href='javascript:ReplyQuote();'> 引用</a>"
        ReBody=ReBody&"</td></tr></table>"
    Rs.close
%>
<script language="JavaScript">
function ReplyQuote() {
    var QuoteValue = '[quote user="' + document.getElementById("RePostAuthor").innerHTML + '"]' +

document.getElementById("ReBody").innerHTML + '[/quote]';
    if (navigator.appName == "Microsoft Internet Explorer"){
        IframeID.focus();
        sel=IframeID.document.selection.createRange();
        sel.pasteHTML(QuoteValue);
    }
    else{
        document.form.TextBody.value+=""+QuoteValue+"\n";
    }
}
</script>
<table width="900" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div id="CommonBreadCrumbArea" wight=900px><%ClubTree%> → <%ForumTree(ParentID)%><%=ForumTreeList%> <a

href=ShowForum.asp?ForumID=<%=ForumID%>><%=ForumName%></a> → <a href="ShowPost.asp?ThreadID=<%=ThreadID%>"><%=Topic%></a> →

回复主题</div></td>
  </tr>
  <tr>
    <td><%=ReBody%></td>
  </tr>
</table>
<br>
<table width=900 align="center" cellpadding=0 cellspacing=1 id=CommonListArea>
<form name="form" method="post" onSubmit="return CheckForm(this);">
<input name="Body" type="hidden">
<input type=hidden name=ThreadID value=<%=ThreadID%>>
<input type=hidden name=PostID value=<%=PostID%>>
<input name="UpFileID" type="hidden">
    <TR id=CommonListTitle>
        <TD vAlign=Left colSpan=2><b>回复主题</b></TD>
    </TR>
    <TR id=CommonListCell>
        <TD width=180><B>标题 </B> </TD>
        <TD><INPUT type="text" maxLength="50" size="60" name="PostSubject"></TD>
    </TR>
    <TR id=CommonListCell>
        <TD vAlign=top>
            <br><B>内容</B><BR>(<a href="javascript:CheckLength();">查看内容长度</a>)<BR><BR><INPUT

id=DisableYBBCode name=DisableYBBCode type=checkbox value=1><label for=DisableYBBCode> 禁用YBB代码</label>
            <%if SiteConfig("UpFileOption")<>empty and PermissionAttachment=1 then%>
                    <BR><BR><span id=UpFile></span><a href="javascript:Wo_Modal.Open

('UploadAttachment.asp',500,150);" class="CommonTextButton">上传附件</a>
            <%end if%>
        </TD>
        <TD height=250><SCRIPT type="text/javascript" src="Editor/Post.js"></SCRIPT></TD>
    </TR>
<%if SiteConfig("DisplayPostTags")=1 then%>
    <TR id=CommonListCell>
        <TD><b>标签<br></b>以逗号“,”分隔</TD>
        <TD><input type="text" name="Tags" size="80" /></TD>
    </TR>
<%end if%>
    <TR id=CommonListCell>
        <TD align=center colSpan=2><INPUT type=submit value=" 回复 " name=EditSubmit> <input type="Button" value="

预览 " onClick="Preview()"> <INPUT onClick="history.back()" type="button" value=" 取消 "></TD>
    </TR>
</FORM>
</TABLE>
<div name="Preview" id="Preview"></div>
<%
HtmlBottom
%>

-----------------------------------------------------------

[[it] 本帖最后由 srom 于 2008-5-21 10:49 编辑 [/it]]
搜索更多相关主题的帖子: 参数 属性 
2008-05-21 10:48
快速回复:错误的参数个数或无效的参数属性值
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024584 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved