本文介绍了“输出"未声明!如何解决此错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在下面的代码中由于未声明输出"而在输出"关键字上遇到错误...
有人请让我知道如何解决这个问题.
提前谢谢.
莎莎
I have encountered an error at "Output" keyword as "Output is not declared" in this below code...
Someone please let me know how to solve this problem.
Thanks in advance.
harsha
Imports AXMMCFGLib
Partial Class _Default
Inherits System.Web.UI.Page
Protected objMessageDB As XMessageDB
Protected objMessage As XMessage
Protected objConstants As XConstants
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
objMessageDB = New XMessageDB
objConstants = New XConstants
objMessageDB.Open()
Dim output As New
output.InnerHtml += "Open: ERROR #" & objMessageDB.LastError & _
" (" & objMessageDB.GetErrorDescription(objMessageDB.LastError) & ")"
output.InnerHtml += "<BR><BR>"
If (objMessageDB.LastError = 0) Then
objMessage = objMessageDB.Create()
output.InnerHtml += "Create: ERROR #" & objMessageDB.LastError & _
" (" & objMessageDB.GetErrorDescription(objMessageDB.LastError) & ")"
output.InnerHtml += "<BR><BR>" & vbCrLf
If (objMessageDB.LastError = 0) Then
output.InnerHtml += "Message Created with ID: " & objMessage.ID
output.InnerHtml += "<BR><BR>" & vbCrLf
objMessage.Direction = objConstants.MESSAGEDIRECTION_OUT
objMessage.Recipient = "+31647134225"
objMessage.Status = objConstants.MESSAGESTATUS_PENDING
objMessage.Type = objConstants.MESSAGETYPE_SMS
objMessage.Body = "Message Created with ASP.NET(VB)"
objMessageDB.Save(objMessage)
output.InnerHtml += "Save: ERROR #" & objMessageDB.LastError & _
" (" & objMessageDB.GetErrorDescription(objMessageDB.LastError) & ")"
output.InnerHtml += "<BR><BR>" & vbCrLf
End If
objMessageDB.Close()
End If
End Sub
End Class
推荐答案
Dim output As New
也许如果您指定了output
应该是new
实例的类型,则效果会更好?
Perhaps if you specified what type output
was supposed to be a new
instance of, it would work better?
Dim output As New
?
这篇关于“输出"未声明!如何解决此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!