谁能帮我看一下这段代码的算法!先谢过!

子夜1978 2007-02-09 09:37:22
private void SaveMult(string fname)
{
string text1 = "";
string text2 = "";
for (int num1 = 0; num1 < this.list1.Items.Count; num1++)
{
text1 = text1 + this.list1.Items[num1].Text + ",";
text2 = text2 + this.list1.Items[num1].SubItems[1].Text;
if ((num1 + 1) < this.list1.Items.Count)
{
text2 = text2 + ",";
}
}
text1 = text1 + text2;
byte[] buffer1 = new byte[text1.Length + 8];
int num2 = 0xfbea;
int num3 = buffer1.Length;
int num4 = 0;
int num5 = 4;
int num6 = buffer1.Length;
BitConverter.GetBytes(num3);
byte[] buffer3 = BitConverter.GetBytes(text1.Length);
Array.Copy(buffer3, 0, buffer1, 4, 4);
Encoding.ASCII.GetBytes(text1, 0, text1.Length, buffer1, 8);
Assembly assembly1 = Assembly.GetExecutingAssembly();
Stream stream1 = assembly1.GetManifestResourceStream("DirectIpManager.table.dat");
byte[] buffer2 = new byte[stream1.Length];
stream1.Read(buffer2, 0, (int) stream1.Length);
stream1.Close();
Convert.ToByte(buffer1.Length);
do
{
num3 = buffer1[num5];
num4 = num2 % 0x100;
num3 ^= num4;
num3 = (buffer2[(num3 * 2) + 1] * 0x100) + buffer2[num3 * 2];
num2 = num2 >> 8;
num2 ^= num3;
num5++;
}
while (num5 < num6);
byte[] buffer4 = BitConverter.GetBytes(num2);
FileStream stream2 = new FileStream(fname, FileMode.Create);
Array.Copy(buffer4, 0, buffer1, 0, 2);
stream2.Write(buffer1, 0, num6);
stream2.Close();
}
...全文
194 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
best8625 2007-02-12
  • 打赏
  • 举报
回复
Up
jxf654 2007-02-12
  • 打赏
  • 举报
回复
up
子夜1978 2007-02-11
  • 打赏
  • 举报
回复
呵呵,大家帮帮忙吧,是老外写的!!
jxf654 2007-02-10
  • 打赏
  • 举报
回复
up
lovedelphi2006 2007-02-09
  • 打赏
  • 举报
回复
请问这是那个叫兽写的这东西,前面把一个LIST的值全写到一个STRING里,又定义一个数组,又用个ARRAY复制,又读个流…………
jaccho 2007-02-09
  • 打赏
  • 举报
回复
你是想干吗聂?看不懂?

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧