我正在尝试使用xceedziplib.dll版本4.2解压缩MCX市场数据,但我无法解压缩,因为我在收到数据不妥协时收到无效的加密密码错误。
如果有任何其他方法可以解压缩MCX市场数据,请留下您的意见......
Console.WriteLine("Waiting for data..");
byte[] tmpData = client.Receive(ref localEp);
string pure1 = System.Text.Encoding.ASCII.GetString(tmpData, 0, tmpData.Length);
Console.WriteLine(pure1);
string length = System.Text.Encoding.ASCII.GetString(tmpData, 0, 5);
int lengthString = Convert.ToInt32(length);
byte[] m_compressedData = new byte[lengthString];
for (int i = 6; i <= lengthString; ++i)
{
m_compressedData[i - 6] = tmpData[i];
}
string pure = System.Text.Encoding.ASCII.GetString(m_compressedData, 0, m_compressedData.Length);
Console.WriteLine(pure);
int offset = 0;
int count = m_compressedData.Length;
//string password = "FD5A148641A8747669842137CD6B1965";
string password = "oms.123";
object vv = (object)m_compressedData;
object cc;
n.EncryptionPassword = "MCX|M!@#C%^&*={}X<>?";
// byte[] uncompressedData = XceedCompressedStreamEx.Decompress(m_compressedData, offset, count, password);
int status =(int)n.Uncompress(ref vv, out cc, true);
string b=n.GetErrorDescription(status);
byte[] testByte = objectToByteArray(cc);
Console.WriteLine(System.Text.Encoding.ASCII.GetString(testByte, 0, testByte.Length));
答案 0 :(得分:0)
不要复制从索引6开始的字节。您应该从索引5开始复制。