以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Dot NET,C#,ASP,VB 』  (http://bbs.xml.org.cn/list.asp?boardid=43)
----  asp.net运行出错  (http://bbs.xml.org.cn/dispbbs.asp?boardid=43&rootid=&id=39986)


--  作者:jflin
--  发布时间:11/14/2006 8:50:00 AM

--  asp.net运行出错
“/chat”应用程序中的服务器错误。
--------------------------------------------------------------------------------

未找到类型“Integer”的默认成员。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.MissingMemberException: 未找到类型“Integer”的默认成员。

源错误:


行 61:             End If
行 62:             count = Application("pubchatnum")
行 63:             Application("pubchat")(count) = Now & Session("user") & "上线"
行 64:             Application("pubchatnum") += 1
行 65:             Response.Redirect("main.aspx")

源文件: c:\inetpub\wwwroot\chat\register.aspx.vb    行: 63

堆栈跟踪:


[MissingMemberException: 未找到类型“Integer”的默认成员。]
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateIndexSet(Object o, Object[] args, String[] paramnames)
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateIndexSetComplex(Object o, Object[] args, String[] paramnames, Boolean OptimisticSet, Boolean RValueBase)
   chat.register.Log_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\chat\register.aspx.vb:63
   System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain() +1277
请问上面的错误是什么错误啊?应该怎么解决啊?



--  作者:jflin
--  发布时间:11/14/2006 8:52:00 AM

--  
这是原代码
Public Class register
    Inherits System.Web.UI.Page

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents Log As System.Web.UI.WebControls.Button
    Protected WithEvents userid As System.Web.UI.WebControls.TextBox
    Protected WithEvents Valid As System.Web.UI.WebControls.RequiredFieldValidator

    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
    '不要删除或移动它。
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
    End Sub

    Private Sub Log_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Log.Click
        Application.Lock()
        If Application("usernum") >= 30 Then
            Response.Write("系统忙,请稍候登陆")
        Else
            Dim username As String
            Dim temp As String
            Dim i, j, num, count As Integer
            username = userid.Text
            num = Application("username")
            For i = 0 To num - 1
                temp = Application("user")(i)
                If username = temp Then
                    Response.Write(username)
                    Response.Write("该用户名已存在,请重新输入")
                    userid.Text = ""
                    Exit Sub
                End If
            Next
            Application("user")(num) = username
            Application("last")(num) = Now
            Application("usernum") += 1
            Session("user") = username
            If Application("usernum") = 1 Then
                Application("admin") = username
            End If
            If Application("pubchatnum") >= 15 Then
                For j = 0 To 13
                    Application("pubchat")(j) = Application("pubchat")(j + 1)
                Next
                Application("pubchatnum") -= 1
            End If
            count = Application("pubchatnum")
            Application("pubchat")(count) = Now & Session("user") & "上线"
            Application("pubchatnum") += 1
            Response.Redirect("main.aspx")
        End If
        Application.UnLock()
    End Sub
End Class


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms