问题描述
调用dll时遇到这个错误:尝试读取或写入受保护的内存。去搜索后配置cmd什么的都没用,这通常指示其他内存已损坏。求大神啊。这是代码stringst_p="287654321123465432109876543210987654329058306432104907127905298765432109876543210987654321998765432128765432112346543210987654321098765432905830643212876543211234654321098765432109876543290583064321049071279052987654321098765432109876543210987654321287654321123465432109876543210987654329058306432128765432112346543210987654321098765432905830643210490712790529876543210987654321098765432199876543212876543211234654321098765432109876543290583064321287654321123465432109876543210987654329058306432104907127905298765432109876543210987654321098765432128765432112346543210987654321098765432905830643216543290583064321";//102weistringst_q="13";stringst_k="12345609871234560987123451234560987123456098712345";stringst_r="8";stringst_m="1";stringkxr=MUL_INT(st_k,st_r);stringpxq=MUL_INT(st_p,st_q);stringmjiakr=ADD_INT(kxr,st_m);stringres=ADD_INT(mjiakr,pxq);Console.Write(res);Console.Write("n");stringm1=MOD_INT(res,st_p);stringm2=MOD_INT(m1,st_k);Console.Write(m2);Console.Write("n");
解决方案
解决方案二:
关键看MUL_INT这些函数的定义和调用是否正确
解决方案三:
添加System.Numerics.dll引用,即可使用BigInteger类型没必要再使用第三方类库你的问题显然是内存溢出了,dll是C++写的吧?
解决方案四:
嗯。内存溢出怎恶魔解决。我也不知道哪里出了问题
解决方案五:
这个类库使用文档说明,或者该类库的源代码