当前位置: 首页>>代码示例>>C#>>正文


C# FileInfo.SetValue方法代码示例

本文整理汇总了C#中System.IO.FileInfo.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# FileInfo.SetValue方法的具体用法?C# FileInfo.SetValue怎么用?C# FileInfo.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.FileInfo的用法示例。


在下文中一共展示了FileInfo.SetValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: lv3_DoubleClick

        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();
            }            
        }
开发者ID:Hagser,项目名称:csharp,代码行数:34,代码来源:Properties.cs

示例2: listView1_DoubleClick

        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            if (cBoxExifInfo.Enabled)
            {
                timer1.Enabled = false;
                ArrayList al = new ArrayList();

                for (int i = 0; i < listView1.Items.Count; i++)
                {
                    ListViewItem lvi = listView1.Items[i];
                    if (isPhoto(lvi.Text))
                    {
                        FileInfo fi = new FileInfo(lvi.SubItems[1].Text + "\\" + lvi.Text);
                        al.Add(fi);
                    }
                    
                }

                FileInfo[] fins = new FileInfo[al.Count];

                for (int i = 0; i < al.Count; i++)
                {
                    FileInfo tmpfi = (FileInfo)al[i];
                    fins.SetValue(tmpfi, i);
                }

                LargePictureForm lpf = new LargePictureForm(fins, listView1.SelectedItems[0].Index);
                lpf.Show();
            }
            else
            {
                try
                {
                    ListViewItem lvi = listView1.SelectedItems[0];
                    Process.Start(lvi.SubItems[1].Text + "\\" + lvi.Text);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
开发者ID:Hagser,项目名称:csharp,代码行数:42,代码来源:Form1.cs

示例3: orderPDUFiles

        private FileInfo[] orderPDUFiles(FileInfo[] files)
        {
            FileInfo[] orderedFileArray = new FileInfo[files.Length];
            foreach(FileInfo pduFile in files)
            {
                string pduFileName = pduFile.Name;
                int index = pduFileName.LastIndexOf("_");
                int pduNr = 0;
                if(index != -1)
                    pduNr = int.Parse(pduFileName.Substring(0,index));

                orderedFileArray.SetValue(pduFile,pduNr);
            }

            return orderedFileArray;
        }
开发者ID:ewcasas,项目名称:DVTK,代码行数:16,代码来源:HLIThread.cs

示例4: propertiesToolStripMenuItem_Click

        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();
        }
开发者ID:Hagser,项目名称:csharp,代码行数:34,代码来源:Form1.cs


注:本文中的System.IO.FileInfo.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。