當前位置: 首頁>>代碼示例>>C#>>正文


C# IO.DJsIO類代碼示例

本文整理匯總了C#中X360.IO.DJsIO的典型用法代碼示例。如果您正苦於以下問題:C# DJsIO類的具體用法?C# DJsIO怎麽用?C# DJsIO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DJsIO類屬於X360.IO命名空間,在下文中一共展示了DJsIO類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: addFileToolStripMenuItem_Click

 private void addFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenFileDialog ofd = new OpenFileDialog();
     ofd.Multiselect = true;
     ofd.Title = "Open Xbox Live Packages";
     ofd.Filter = "";
     if (ofd.ShowDialog() != DialogResult.OK)
         return;
     menuStrip1.Enabled = groupPanel1.Enabled = listBox1.Enabled = false;
     progressBarX1.Value = 0;
     progressBarX1.Maximum = ofd.FileNames.Length;
     foreach (string x in ofd.FileNames)
     {
         DJsIO y = null;
         try { y = new DJsIO(x, DJFileMode.Open, true); }
         catch { progressBarX1.Value++; continue; }
         if (!y.Accessed)
         {
             progressBarX1.Value++;
             continue;
         }
         y.Position = 0;
         if (y.ReadUInt32() == (uint)AllMagic.CON)
             listBox1.Items.Add(x);
         y.Dispose();
         if (checkBoxX3.Checked)
             fix(listBox1.Items.Count - 1);
         progressBarX1.Value++;
     }
     menuStrip1.Enabled = groupPanel1.Enabled = listBox1.Enabled = true;
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:31,代碼來源:MultiSTFS.cs

示例2: Package

        internal Package(STFSPackage pk, bool readData = true, DJsIO dj = null)
        {
            this.package = pk;
            this.dj = dj;

            ReadData(readData, this);
        }
開發者ID:BGCX261,項目名稱:ziggy-pro-editor-svn-to-git,代碼行數:7,代碼來源:Package.cs

示例3: MusicFile

 /// <summary>
 /// Initializes this object
 /// </summary>
 /// <param name="FileLocale"></param>
 public MusicFile(string FileLocale)
 {
     xActive = true;
     DJsIO xIO = new DJsIO(FileLocale, DJFileMode.Open, true);
     if (!xIO.Accessed)
         throw STFSExcepts.ParseError;
     try
     {
         xIO.Position = 0;
         xIO.IsBigEndian = true;
         if (xIO.ReadUInt32() != 0x464D494D)
             throw MusicExcepts.NotMusic;
         xIO.Position = 0xC;
         so = xIO.ReadString(StringForm.Unicode, 0x100);
         al = xIO.ReadString(StringForm.Unicode, 0x100);
         ar = xIO.ReadString(StringForm.Unicode, 0x100);
         xIO.Position += 0x200;
         ge = xIO.ReadString(StringForm.Unicode, 0x100);
         IO = xIO;
         xActive = false;
     }
     catch { xIO.Dispose(); throw STFSExcepts.ParseError; }
 }
開發者ID:BGCX261,項目名稱:ziggy-pro-editor-svn-to-git,代碼行數:27,代碼來源:Music.cs

示例4: listView1_DragDrop

 private void listView1_DragDrop(object sender, DragEventArgs e)
 {
     List<string> xData = new List<string>((string[])e.Data.GetData(DataFormats.FileDrop));
     List<DJsIO> xIO = new List<DJsIO>();
     for (int i = 0; i < xData.Count; i++)
     {
         DJsIO blah = new DJsIO(xData[i], DJFileMode.Open, true);
         if (blah.Accessed)
             xIO.Add(blah);
     }
     if (xIO.Count == 0)
         return;
     if (MessageBox.Show("Are you sure you want to add " + ((xIO.Count == 1) ? "this accessed file?" : ("these " + xIO.Count.ToString() + " accessed files?")), "Rawr?", MessageBoxButtons.YesNo) != DialogResult.Yes)
         return;
     foreach (DJsIO x in xIO)
         xPackage.MakeFile(x.FileNameShort, x, ((FolderEntry)advTree1.SelectedNode.DataKey).EntryID, AddType.NoOverWrite);
     xReturn_NodeClick(advTree1.SelectedNode, null);
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:18,代碼來源:PackageExplorer.cs

示例5: addFileToolStripMenuItem_Click

 private void addFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DJsIO x = new DJsIO(DJFileMode.Open, "Open", "", true);
     if (!x.Accessed)
         return;
     Renamer rename = new Renamer(x.FileNameShort, true);
     if (rename.ShowDialog() != DialogResult.OK)
     {
         x.Close();
         return;
     }
     xPackage.MakeFile(rename.FileName, x, ((FolderEntry)advTree1.SelectedNode.DataKey).EntryID, AddType.NoOverWrite);
     Log("Done adding");
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:14,代碼來源:PackageExplorer.cs

示例6: KerberosDecrypt

 /// <summary>
 /// Runs a Kerberos implemented RC4 decryption
 /// </summary>
 /// <param name="xConfounder">The confounder input</param>
 /// <param name="xPayload">The payload input</param>
 /// <param name="x">RC4 reference</param>
 /// <param name="xData">Data to be decrypted</param>
 /// <param name="xConLen">Length of the Confounder</param>
 /// <returns></returns>
 public static bool KerberosDecrypt(this RC4 x, byte[] xData, out byte[] xConfounder, int xConLen, out byte[] xPayload)
 {
     xPayload = new byte[0];
     xConfounder = new byte[0];
     try
     {
         DJsIO xOut = new DJsIO(x.RunAlgorithm(xData), true);
         xOut.Position = 0;
         xConfounder = xOut.ReadBytes(xConLen);
         xPayload = xOut.ReadBytes(xData.Length - xConLen);
         xOut.Dispose();
     }
     catch { return false; }
     return true;
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:24,代碼來源:Cryptography.cs

示例7: xExtract

 bool xExtract(string xOut, bool Sub)
 {
     if (!VariousFunctions.xCheckDirectory(xOut))
         return false;
     FATXReadContents xread = xRead();
     if (xread == null)
         return false;
     foreach (FATXFileEntry x in xread.Files)
     {
         DJsIO xIOOut = new DJsIO(xOut + "/" + x.Name, DJFileMode.Create, true);
         if (!xIOOut.Accessed)
             continue;
         x.xExtract(ref xIOOut);
         xIOOut.Dispose();
     }
     if (!Sub)
         return true;
     foreach (FATXFolderEntry x in xread.Folders)
         x.xExtract(xOut + "/" + x.Name, Sub);
     return true;
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:21,代碼來源:Entries.cs

示例8: AddFile

 /// <summary>
 /// Adds a file
 /// </summary>
 /// <param name="FileName"></param>
 /// <param name="FileLocation"></param>
 /// <param name="xType"></param>
 /// <returns></returns>
 public bool AddFile(string FileName, string FileLocation, AddType xType)
 {
     FileName.IsValidXboxName();
     if (xDrive.ActiveCheck())
         return false;
     DJsIO xIOIn = null;
     try { xIOIn = new DJsIO(FileLocation, DJFileMode.Open, true); }
     catch { return (xDrive.xActive = false); }
     try
     {
         FATXReadContents xconts = xRead();
         foreach (FATXFileEntry x in xconts.xfiles)
         {
             if (x.Name == FileName)
             {
                 bool xreturn = false;
                 if (xType == AddType.NoOverWrite)
                      return (xDrive.xActive = false);
                 else if (xType == AddType.Inject)
                     xreturn = x.xInject(xIOIn);
                 else xreturn = x.xReplace(xIOIn);
                 return (xreturn & !(xDrive.xActive = false));
             }
         }
         uint xnew = 0;
         long xpos = GetNewEntryPos(out xnew);
         if (xpos == -1)
             return (xDrive.xActive = false);
         uint[] blocks = Partition.xTable.GetNewBlockChain(xIOIn.BlockCountFATX(Partition), xnew + 1);
         if (blocks.Length == 0)
             return (xDrive.xActive = false);
         if (!Partition.WriteFile(blocks, ref xIOIn))
             return (xDrive.xActive = false);
         FATXEntry y = new FATXEntry(FileName, blocks[0], (int)xIOIn.Length, xpos, false, ref xDrive);
         if (!y.xWriteEntry())
             return (xDrive.xActive = false);
         if (xnew > 0)
         {
             List<uint> fileblocks = new List<uint>(Partition.xTable.GetBlocks(xStartBlock));
             fileblocks.Add(xnew);
             uint[] xtemp = fileblocks.ToArray();
             if (!Partition.xTable.WriteChain(ref xtemp))
                 return (xDrive.xActive = false);
         }
         if (!Partition.xTable.WriteChain(ref blocks))
             return (xDrive.xActive = false);
         if (Partition.WriteAllocTable())
             return !(xDrive.xActive = false);
         return (xDrive.xActive = false);
     }
     catch { xIOIn.Close(); return (xDrive.xActive = false); }
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:59,代碼來源:Entries.cs

示例9: xInject

 internal bool xInject(DJsIO xIOIn)
 {
     List<uint> blocks = new List<uint>(Partition.xTable.GetBlocks(xStartBlock));
     if (blocks.Count == 0)
         throw new Exception();
     uint xct = xIOIn.BlockCountFATX(Partition);
     if (blocks.Count < xct)
     {
         uint[] blocks2 = Partition.xTable.GetNewBlockChain((uint)(xct - blocks.Count), 1);
         if (blocks2.Length == 0)
             throw new Exception();
         blocks.AddRange(blocks2);
         uint[] x = blocks.ToArray();
         if (!Partition.xTable.WriteChain(ref x))
             throw new Exception();
     }
     else if (blocks.Count > xct)
     {
         uint[] xUnneeded = new uint[blocks.Count - xct];
         for (uint i = xct; i < blocks.Count; i++)
         {
             xUnneeded[(int)i] = i;
             blocks.RemoveAt((int)i--);
         }
         if (!Partition.xTable.DC(ref xUnneeded))
             throw new Exception();
     }
     xIOIn.Position = 0;
     xDrive.GetIO();
     foreach (uint i in blocks)
     {
         xDrive.xIO.Position = Partition.BlockToOffset(i);
         xDrive.xIO.Write(xIOIn.ReadBytes(Partition.xBlockSize));
     }
     if ((xSize == 0 || (uint)(((xSize - 1) / Partition.xBlockSize) + 1) != xct) &&
         !Partition.WriteAllocTable())
         throw new Exception();
     xSize = (int)xIOIn.Length;
     xIOIn.Close();
     return xWriteEntry();
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:41,代碼來源:Entries.cs

示例10: extractimg

 bool extractimg(DJsIO xIOOut)
 {
     extthrd(xIOOut);
     //System.Threading.Thread x = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(extthrd));
     // x.Start(xIOOut);
     //while (x.IsAlive)
     //    System.Windows.Forms.Application.DoEvents();
     if (xactive)
         return (xactive = false);
     return (!xactive);
 }
開發者ID:BGCX261,項目名稱:ziggy-pro-editor-svn-to-git,代碼行數:11,代碼來源:Management.cs

示例11: ExtractImage

 /// <summary>
 /// Extract a binary image of your FATX Drive
 /// </summary>
 /// <param name="xIOOut"></param>
 /// <returns></returns>
 public bool ExtractImage(DJsIO xIOOut)
 {
     if (ActiveCheck())
         return false;
     return extractimg(xIOOut);
 }
開發者ID:BGCX261,項目名稱:ziggy-pro-editor-svn-to-git,代碼行數:11,代碼來源:Management.cs

示例12: FATXDrive

 /// <summary>
 /// Read a FATX Image
 /// </summary>
 /// <param name="xImage"></param>
 public FATXDrive(DJsIO xImage)
 {
     if (xImage == null || !xImage.Accessed)
         return;
     if (!FATXManagement.IsFATX(ref xImage, out xType))
         throw new Exception("Drive is not FATX");
     xIO = xImage;
     LoadPartitions();
 }
開發者ID:BGCX261,項目名稱:ziggy-pro-editor-svn-to-git,代碼行數:13,代碼來源:Management.cs

示例13: Replace

 /// <summary>
 /// Replace the file
 /// </summary>
 /// <param name="FileIn"></param>
 /// <returns></returns>
 public bool Replace(string FileIn)
 {
     if (xDrive.ActiveCheck())
         return false;
     DJsIO xIOIn = null;
     try { xIOIn = new DJsIO(FileIn, DJFileMode.Open, true); }
     catch { return (xDrive.xActive = false); }
     if (xIOIn == null || !xIOIn.Accessed)
         return (xDrive.xActive = false);
     return xReplace(xIOIn) & !(xDrive.xActive = false);
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:16,代碼來源:Entries.cs

示例14: AddFile

        public bool AddFile(string FileName, byte[] fileData, AddType xType)
        {
            if (!VariousFunctions.IsValidXboxName(FileName))
                return false;

            if (xDrive.ActiveCheck())
                return false;

            DJsIO xIOIn = null;
            byte[] b = fileData;
            xIOIn = new DJsIO(b, true);

            try
            {
                FATXReadContents xconts = xRead();
                foreach (FATXFileEntry x in xconts.xfiles)
                {
                    if (string.Compare(x.Name, FileName, true) == 0)
                    {
                        bool xreturn = false;
                        if (xType == AddType.NoOverWrite)
                        {
                            xIOIn.Close();
                            return (xDrive.xActive = false);
                        }
                        else if (xType == AddType.Inject)
                        {
                            xreturn = x.xInject(xIOIn);
                        }
                        else
                        {
                            xreturn = x.xReplace(xIOIn);
                        }
                        xIOIn.Close();
                        return (xreturn & !(xDrive.xActive = false));
                    }
                }
                uint xnew = 0;
                long xpos = GetNewEntryPos(out xnew);
                if (xpos == -1)
                    return (xDrive.xActive = false);

                var count = xIOIn.BlockCountFATX(Partition);

                uint[] blocks = Partition.xTable.GetNewBlockChain(count, xnew + 1);

                if (blocks.Length == 0)
                    return (xDrive.xActive = false);

                if (!Partition.WriteFile(blocks, ref xIOIn))
                    return (xDrive.xActive = false);

                FATXEntry y = new FATXEntry(this,
                    FileName,
                    blocks[0], (int)xIOIn.Length,
                    xpos, false, ref xDrive);

                if (!y.xWriteEntry())
                    return (xDrive.xActive = false);

                if (xnew > 0)
                {
                    var filebx = Partition.xTable.GetBlocks(xStartBlock);
                    List<uint> fileblocks = new List<uint>(filebx);

                    fileblocks.Add(xnew);

                    uint[] xtemp = fileblocks.ToArray();

                    if (!Partition.xTable.WriteChain(ref xtemp))
                        return (xDrive.xActive = false);
                }

                if (!Partition.xTable.WriteChain(ref blocks))
                    return (xDrive.xActive = false);

                if (Partition.WriteAllocTable())
                    return !(xDrive.xActive = false);

                return (xDrive.xActive = false);
            }
            catch { xIOIn.Close(); return (xDrive.xActive = false); }
        }
開發者ID:BGCX261,項目名稱:ziggy-pro-editor-svn-to-git,代碼行數:83,代碼來源:Entries.cs

示例15: xReplace

 internal bool xReplace(DJsIO xIOIn)
 {
     uint bu = xStartBlock;
     int size = xSize;
     try
     {
         uint[] curblocks = Partition.xTable.GetBlocks(xStartBlock);
         uint[] blocks = Partition.xTable.GetNewBlockChain(xIOIn.BlockCountFATX(Partition), 1);
         if (blocks.Length == 0)
             throw new Exception();
         if (!Partition.xTable.WriteChain(ref blocks))
             throw new Exception();
         if (!Partition.xTable.DC(ref curblocks))
             throw new Exception();
         xIOIn.Position = 0;
         xDrive.GetIO();
         if (!Partition.WriteFile(blocks, ref xIOIn))
             throw new Exception();
         if (!Partition.WriteAllocTable())
             throw new Exception();
         base.xStartBlock = blocks[0];
         base.xSize = (int)xIOIn.Length;
         xIOIn.Close();
         return xWriteEntry();
     }
     catch { xIOIn.Close(); base.xStartBlock = bu; base.xSize = size; return false; }
 }
開發者ID:VictorOverX,項目名稱:X360,代碼行數:27,代碼來源:Entries.cs


注:本文中的X360.IO.DJsIO類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。