我正在使用服务器端主动x控件进行分页(http://activexperts.com/xmstoolkit/)。下面的代码在Windows 2003服务器上找到了,但现在我们转移到了Windows 2008,我收到了以下错误:
System.AccessViolationException:尝试读取或写入受保护的 记忆。这通常是一个迹象 其他内存已损坏。在 AXmsCtrl.PagerProtocolSnppClass.Clear() 在_Default.Button1_Click(对象 发件人,EventArgs e)in d:\ APPS \ pagetest \ Default.aspx.vb:行 15
我搜索并阅读各种线程,但无法找到解决方案。在此先感谢您的帮助。
以下是代码:
Partial Class _Default
Inherits System.Web.UI.Page
Private objSnppProtocol As PagerProtocolSnpp = New PagerProtocolSnpp
Private objPagerMessage As PagerMessage = New PagerMessage
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
objPagerMessage.Clear()
objPagerMessage.Recipient = "12345"
objPagerMessage.Data = "Testing send page."
objSnppProtocol.Clear()
objSnppProtocol.Server = "111.111.11.11"
objSnppProtocol.ServerPort = System.Int32.Parse("446")
objSnppProtocol.ServerTimeout = 2000
objSnppProtocol.ProviderPassword = "2125551212 2125551212"
objSnppProtocol.LogFile = Server.MapPath("log.txt")
' Send
objSnppProtocol.Send(objPagerMessage)
UpdateResult(objSnppProtocol.LastError, objSnppProtocol.ProviderResponse)
Catch exc As Exception
Response.Write("<br><font color='maroon'><strong>Paging ERROR:</strong></font><br>" & exc.ToString() & "<br>Trace: " & exc.StackTrace.ToString())
End Try
End Sub
Private Sub UpdateResult(ByVal numResult As System.Int32, ByVal strResponse As String)
ctlResult.Text = numResult.ToString() & ": " & objSnppProtocol.GetErrorDescription(numResult)
ctlResponse.Text = strResponse
End Sub
End Class
答案 0 :(得分:2)
您的组件在非托管代码中崩溃 - 请与供应商联系。 - 您现在也试图在64位系统上运行32位代码吗?