本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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;
}
示例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)
{
}
}