本文介绍了设备运行时内存损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我创建一个程序来操作设备。该设备是检查接收器。当设备准备接受时,我放置支票,设备将进给。但检查后异常提高尝试读取或写入受保护的内存。这通常表明其他内存已损坏。
如何解决此问题问题。?我接受的代码如下:
Hi all,
I create a program to operate a device. The device is check acceptor. When the device is ready accepting, I place the check and the device will feed. But the exception raise after check is feeding "Attempt to read or write Protected Memory. This is often an indicating that other memory is corrupt".
How to solve this kind of problem.? My code to accept is below:
Public Shared Function StartAccepting(ByVal intTime As Integer) As Boolean
Dim ret As Boolean
Dim time As Integer = intTime
Dim strTmp(300) As Byte
Dim strStr As String
Dim enc As New System.Text.ASCIIEncoding()
Try
ret = RunAccept(time, strTmp(0))
strStr = enc.GetString(strTmp)
If ret Then
Return True
Else
Return False
End If
Catch ex As Exception
MsgBox("Error opening:ExMsg-" & ex.Message)
Return False
End Try
End Function
粗体代码后的异常提升。返回后..
Exception raise after the bold code. after it return..
推荐答案
这篇关于设备运行时内存损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!