예제 #1
0
        void lv3_DoubleClick(object sender, EventArgs e)
        {
            ListViewItem lvi = lv3.SelectedItems[0];
            ArrayList    al  = (ArrayList)lvi.Tag;
            FileInfo     fi  = (FileInfo)al[0];

            zip.Zip.ZipFile  zf = (zip.Zip.ZipFile)al[1];
            zip.Zip.ZipEntry ze = (zip.Zip.ZipEntry)al[2];

            string strFName = fi.FullName;

            string strName   = ze.Name;
            string strParent = "";

            if (strName.IndexOf("/") != -1)
            {
                string[] strNameArr = strName.Split(Encoding.Default.GetChars(Encoding.Default.GetBytes("/")));
                strName = strNameArr[strNameArr.Length - 1];
                for (int i = 0; i < strNameArr.Length - 2; i++)
                {
                    strParent += "\\" + strNameArr[i];
                }
            }

            if (isZip(strFName))
            {
                zip.Zip.FastZip fz = new ICSharpCode.SharpZipLib.Zip.FastZip();
                fz.ExtractZip(strFName, Application.UserAppDataPath + strParent, ze.Name);

                FileInfo[] fins = new FileInfo[1];
                fins.SetValue(new FileInfo(Application.UserAppDataPath + "\\" + ze.Name), 0);
                PropForm pf = new PropForm(fins);
                pf.Show();
            }
        }
예제 #2
0
        private void propertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FileInfo[] fins = new FileInfo[listView1.SelectedItems.Count];
            for (int i = 0; i < listView1.SelectedItems.Count; i++)
            {
                ListViewItem lvi = listView1.SelectedItems[i];

                fins.SetValue(new FileInfo(lvi.SubItems[1].Text + "\\" + lvi.Text), i);

                /*
                 * string strText = "";
                 * string strPath = lvi.SubItems[1].Text + "\\" + lvi.Text;
                 * if (isPhoto(strPath))
                 * {
                 *  Hashtable ht = getEXIF(strPath);
                 *  foreach (DictionaryEntry de in ht)
                 *  {
                 *      strText += de.Key + ":" + de.Value + "\n";
                 *  }
                 * }
                 * else if (isMedia(strPath))
                 * {
                 *  Hashtable ht = getMediaInfo(strPath);
                 *  foreach (DictionaryEntry de in ht)
                 *  {
                 *      strText += de.Key + ":" + de.Value + "\n";
                 *  }
                 * }
                 * MessageBox.Show(strText);
                 */
            }
            PropForm pf = new PropForm(fins);

            pf.Show();
        }
예제 #3
0
파일: Properties.cs 프로젝트: Hagser/csharp
        void lv3_DoubleClick(object sender, EventArgs e)
        {
            ListViewItem lvi = lv3.SelectedItems[0];
            ArrayList al = (ArrayList)lvi.Tag;
            FileInfo fi=(FileInfo)al[0];
            zip.Zip.ZipFile zf=(zip.Zip.ZipFile)al[1];
            zip.Zip.ZipEntry ze=(zip.Zip.ZipEntry)al[2];

            string strFName = fi.FullName;

            string strName = ze.Name;
            string strParent = "";

            if (strName.IndexOf("/") != -1)
            {
                string[] strNameArr = strName.Split(Encoding.Default.GetChars(Encoding.Default.GetBytes("/")));
                strName = strNameArr[strNameArr.Length - 1];
                for (int i = 0; i < strNameArr.Length - 2; i++)
                {
                    strParent += "\\" + strNameArr[i];
                }
            }

            if (isZip(strFName))
            {
                zip.Zip.FastZip fz = new ICSharpCode.SharpZipLib.Zip.FastZip();
                fz.ExtractZip(strFName, Application.UserAppDataPath + strParent, ze.Name);
                
                FileInfo[] fins = new FileInfo[1];
                fins.SetValue(new FileInfo(Application.UserAppDataPath + "\\" + ze.Name), 0);
                PropForm pf = new PropForm(fins);
                pf.Show();
            }            
        }
예제 #4
0
파일: Form1.cs 프로젝트: Hagser/csharp
        private void propertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FileInfo[] fins = new FileInfo[listView1.SelectedItems.Count];
            for (int i=0;i<listView1.SelectedItems.Count;i++)
            {
                ListViewItem lvi = listView1.SelectedItems[i];

                fins.SetValue(new FileInfo(lvi.SubItems[1].Text + "\\" + lvi.Text), i);
                /*
                string strText = "";
                string strPath = lvi.SubItems[1].Text + "\\" + lvi.Text;
                if (isPhoto(strPath))
                {
                    Hashtable ht = getEXIF(strPath);
                    foreach (DictionaryEntry de in ht)
                    {
                        strText += de.Key + ":" + de.Value + "\n";
                    }
                }
                else if (isMedia(strPath))
                {
                    Hashtable ht = getMediaInfo(strPath);
                    foreach (DictionaryEntry de in ht)
                    {
                        strText += de.Key + ":" + de.Value + "\n";
                    }
                }
                MessageBox.Show(strText);
                */

            }
            PropForm pf = new PropForm(fins);
            pf.Show();
        }