标签:blog class code ext get int
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | stringpath = textBox1.Text;            FileStream fs = File.OpenRead(path);            byte[] bytes = newbyte[fs.Length];            fs.Read(bytes, 0, bytes.Length);            fs.Close();            for(inti = 0; i < bytes.Length; i++)            {                bytes[i] = (byte)(bytes[i] ^ 0xF7);            }            inti2 = 9;            intendTag;            List<mFileInfo> files = newList<mFileInfo>();            do            {                intfileNameLength = bytes[i2];                i2++;                stringfileName = Encoding.ASCII.GetString(bytes, i2, fileNameLength);                i2 += fileNameLength;                intfileLength = BitConverter.ToInt32(bytes, i2);                i2 += 4;                stringunKnow = Encoding.ASCII.GetString(bytes, i2, 8);                i2 += 8;                endTag = bytes[i2];                Debug.Print("length:{0} name:{1} fileLength:{2} endTag{3}", fileNameLength, fileName, fileLength, endTag);                i2++;                files.Add(newmFileInfo() { mfileName = fileName, mfileSize = fileLength });            } while(endTag == 0);            stringmainPath = textBox2.Text;            progressBar1.Maximum = files.Count;            foreach(mFileInfo mfInfo infiles)            {                progressBar1.Value++;                string[] strings = mfInfo.mfileName.Split(‘\\‘);                stringtempPath = mainPath;                if(strings.Length > 1)                {                    for(inti3 = 0; i3 < strings.Length - 1; i3++)                    {                        if(!Directory.Exists(tempPath + strings[i3]))                        {                            Directory.CreateDirectory(tempPath + strings[i3]);                        }                        tempPath += strings[i3] + "\\";                    }                }                FileStream fs2 = newFileStream(mainPath + mfInfo.mfileName, FileMode.Create);                fs2.Write(bytes, i2, mfInfo.mfileSize);                fs2.Flush();                fs2.Close();                i2 += mfInfo.mfileSize;            } | 
标签:blog class code ext get int
原文地址:http://www.cnblogs.com/qq578023708/p/3705911.html