我用的是MySQLDriverCS驱动
要实现以下功能
// 制作Torrent文件。这个函数一般不用,仅供测试用
string TorrentName = "@" + MovieName + ".torrent";
makeTorrent.MakeTorrentFile(TorrentName);
// 在内存中生成Torrent
IStream stream = makeTorrent.MakeTorrentStream();
tagSTATSTG statStg = new tagSTATSTG();
stream.Stat(out statStg, 1);
byte[] torrentArray = new byte[statStg.cbSize.QuadPart];
uint readedSize;
stream.RemoteRead(out torrentArray[0], (uint)statStg.cbSize.QuadPart, out readedSize);
makeTorrent.CloseTorrent();
----------以上功能没问题-----
现在想把 内存中的Torrent字节流保存到数据库的Torrent字段
MySQLConnection conntt=new ...
conntt.Open();
new MySQLUpdateCommand(conntt,
new object[,] { { "Torrent", torrentArray } },
"movie",
new object[,] { { "MovieID", "=", "69" } },
null
);
对 PInvoke 函数“MySQLDriverCS!MySQLDriverCS.CPrototypes::mysql_real_escape_string”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。如何解决???
要实现以下功能
// 制作Torrent文件。这个函数一般不用,仅供测试用
string TorrentName = "@" + MovieName + ".torrent";
makeTorrent.MakeTorrentFile(TorrentName);
// 在内存中生成Torrent
IStream stream = makeTorrent.MakeTorrentStream();
tagSTATSTG statStg = new tagSTATSTG();
stream.Stat(out statStg, 1);
byte[] torrentArray = new byte[statStg.cbSize.QuadPart];
uint readedSize;
stream.RemoteRead(out torrentArray[0], (uint)statStg.cbSize.QuadPart, out readedSize);
makeTorrent.CloseTorrent();
----------以上功能没问题-----
现在想把 内存中的Torrent字节流保存到数据库的Torrent字段
MySQLConnection conntt=new ...
conntt.Open();
new MySQLUpdateCommand(conntt,
new object[,] { { "Torrent", torrentArray } },
"movie",
new object[,] { { "MovieID", "=", "69" } },
null
);
对 PInvoke 函数“MySQLDriverCS!MySQLDriverCS.CPrototypes::mysql_real_escape_string”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。如何解决???
我来告诉原因 MySQLDriverCS 的问题 呵呵 想解决下源代码自己改 呵呵