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


C# FileInfo.Count方法代码示例

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


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

示例1: ProcessFiles

        public static void ProcessFiles(FileInfo[] files, int speedupFactor, Rational outputFramesPerSecond)
        {
            var i = 1;
            var filesCount = files.Count();
            var engine = new HyperlapseEngine();

            engine.ProcessingCancelled += OnEngineProcessingCancelled;
            engine.ProcessingFailed += OnEngineProcessingFailed;
            engine.ProcessingFinished += OnEngineProcessingFinished;
            engine.ProgressChanged += OnEngineProgressChanged;
            engine.TrialStatusChanged += OnEngineTrialStatusChanged;

            foreach (var file in files)
            {
                var processingMsg = "[Processing file " + i++ + " of " + filesCount + "] - " + file.Name;
                Console.Title = processingMsg;
                Console.WriteLine(processingMsg);

                var fileOutput = new FileInfo(Path.Combine(file.DirectoryName, "Output", file.Name));
                if (!fileOutput.Directory.Exists)
                {
                    fileOutput.Directory.Create(); // create output dir
                }

                Process(engine, file, fileOutput, speedupFactor, outputFramesPerSecond);
            }

            engine.Dispose();
        }
开发者ID:joaompneves,项目名称:HyperlapseBatchProcessor,代码行数:29,代码来源:HyperlapseWrapper.cs

示例2: loadAllTextureFilesToManager

        public static void loadAllTextureFilesToManager( ContentManager content, string path, FileInfo[] fileList, GenericManager<string, Texture2D> textureManager, string extension = null, bool append = false )
        {
            // Start loadAllTextureFiles.

            if ( !append )
            {
                textureManager.unlockList();
                textureManager.clearList();
            }
            else
                textureManager.unlockList();

            int listCount = fileList.Count();
            for (int i = 0; i < listCount; i++)
            {
                if( extension != null )
                    if( fileList[i].Extension != extension )
                        return;

                textureManager.addObject( fileList[i].ToString(), content.Load<Texture2D>( path + fileList[i].Name ) );
            }

            textureManager.lockList();
        }
开发者ID:ericamccowan,项目名称:ILS,代码行数:24,代码来源:FileListHelper.cs

示例3: compareSourceAndTarget

        private static bool compareSourceAndTarget(FileInfo[] source, FileInfo[] target)
        {
            if (source == null && target == null) return true;
            if (source.Count() != target.Count()) return false;
            int files = source.Count();

            return true;
        }
开发者ID:Epibatidin,项目名称:FLUX,代码行数:8,代码来源:Algs.cs

示例4: DownloadFiles

        public ResponseMultiFile DownloadFiles(RequestFiles request)
        {
            // DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\77\Desktop\PDF");
            //   FileInfo[] files = directoryInfo.GetFiles("*.*", SearchOption.AllDirectories);

            SetPath(request.pathflag);

            FileInfo[] files = new FileInfo[request.FilePath.Count];

            for (int i = 0; i < request.FilePath.Count; i++)
            {
                files[i] = (new FileInfo(Path.Combine(path, request.FilePath[i].ToString())));
            }

            ResponseMultiFile[] result = new ResponseMultiFile[files.Count<FileInfo>()];

            FileStream stream = this.GetFileStream(Path.GetFullPath(files[request.idx].FullName));
            stream.Seek(request.byteStart, SeekOrigin.Begin);
            result[request.idx] = new ResponseMultiFile();
            result[request.idx].FileName = files[request.idx].FullName;
            result[request.idx].Length = stream.Length;
            result[request.idx].FileByteStream = stream;

            ResponseMultiFile retval = result[request.idx];

            return retval;
        }
开发者ID:gawallsibya,项目名称:BIT_TeamProject,代码行数:27,代码来源:ISIU.cs

示例5: ShowAllFramesOnPanel

        /// <summary>
        /// reason : To show all frames of video in panel
        /// </summary>
        /// <param name="files"></param>
        /// <param name="imageName"></param>
        private void ShowAllFramesOnPanel(FileInfo[] files,string imageName)
        {
            flowLayoutPanel1.BringToFront();
            try
            {

                PictureBox[] pics = new PictureBox[files.Count()];
                FlowLayoutPanel[] flws = new FlowLayoutPanel[files.Count()];
                Label[] lbl = new Label[files.Count()];
                _faceDetection = new FaceDetection(appStartPath);
                int brh = 0;
                for (int i = 0; i < files.Count(); i++)
                {
                    if (!File.Exists(files[i].FullName))
                        continue;

                    noOfFaces = 0;
                    newFrame = null;
                    _faceDetection.DetectFace(appStartPath, files[i].FullName, ref noOfFaces, ref newFrame);
                    flws[i] = new FlowLayoutPanel();
                    flws[i].Name = "flw" + i;
                    flws[i].Location = new Point(3, brh);
                    flws[i].Size = new Size(217, 210);
                    flws[i].BackColor = Color.DarkCyan;
                    flws[i].BorderStyle = BorderStyle.Fixed3D;

                    lbl[i] = new Label();
                    lbl[i].Name = files[i].Name;
                    lbl[i].Size = new Size(100, 35);
                    lbl[i].Text = "Frame " + i + " Contains " + noOfFaces + " Face(s)";

                    pics[i] = new PictureBox();
                    pics[i].Name = files[i].FullName;
                    pics[i].Size = new Size(217, 175);
                    pics[i].Image = newFrame==null?  System.Drawing.Image.FromFile(files[i].FullName): newFrame;
                    pics[i].SizeMode = PictureBoxSizeMode.StretchImage;

                    flws[i].Controls.Add(lbl[i]);
                    flws[i].Controls.Add(pics[i]);
                   
                    this.Controls.Add(flws[i]);
                    flowLayoutPanel1.Controls.Add(flws[i]);
                }
            }
            catch(Exception)
            {
            }
        }
开发者ID:pankajw-cuelogic,项目名称:ImageProcessing,代码行数:53,代码来源:frmImageProcessing.cs


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