我根据别人写的用vb调用的代码,进行改装到c#里面,但是会报以下异常:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
vb代码如下:

End Function

c#代码如下:

关于用zlibwapi.dll进行字节数组压缩的问题[DllImport("kernel32.dll")]
关于用zlibwapi.dll进行字节数组压缩的问题        
public unsafe static extern void CopyMemory(IntPtr hpvDest, IntPtr hpvSource, int cbCopy);
关于用zlibwapi.dll进行字节数组压缩的问题        [DllImport(
"zlibwapi.dll")]
关于用zlibwapi.dll进行字节数组压缩的问题        
public unsafe static extern int compress(IntPtr dest, int destLen, IntPtr src, int srcLen);
关于用zlibwapi.dll进行字节数组压缩的问题        [DllImport(
"zlibwapi.dll")]
关于用zlibwapi.dll进行字节数组压缩的问题        
public unsafe static extern int uncompress(IntPtr dest, int destLen, IntPtr src, int srcLen);
关于用zlibwapi.dll进行字节数组压缩的问题
关于用zlibwapi.dll进行字节数组压缩的问题        
private const long OFFSET = 8;
关于用zlibwapi.dll进行字节数组压缩的问题 
private void button2_Click(object sender, EventArgs e)
        }



 

相关文章: