Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

asp.net get most recent file in directory

var directory = new DirectoryInfo("C:MyDirectory");
var myFile = (from f in directory.GetFiles()
             orderby f.LastWriteTime descending
             select f).First();

// or...
var myFile = directory.GetFiles()
             .OrderByDescending(f => f.LastWriteTime)
             .First();
Comment

PREVIOUS NEXT
Code Example
Csharp :: ArgumentException: Input Key named: Fire1 is unknown 
Csharp :: c# Intersectcase insensitive 
Csharp :: c# read excel file into datatable 
Csharp :: how to do that a objetct moves in c# 
Csharp :: c# window form align right bottom 
Csharp :: upload a file selenium c# 
Csharp :: csharp 3d array length 
Csharp :: moq set delay to return 
Csharp :: c# json 
Csharp :: save position unity 
Csharp :: verifyusertokenasync password reset token 
Csharp :: global variables unity 
Csharp :: unity unhide object 
Csharp :: unity datetime to string 
Csharp :: c# progress bar timer 
Csharp :: c# Sum of all the factors of a number 
Csharp :: how to call an If statement only once in C# 
Csharp :: query associative table ef6 
Csharp :: c# get executing file name 
Csharp :: Get logged in user in ASP.Net 
Csharp :: .net core copy file in folder to root 
Csharp :: modal barrier in flutter 
Csharp :: how to compare time strings in c# 
Csharp :: unity find deactivated gameobject 
Csharp :: c# subtract 24 hours form datetime 
Csharp :: narcissistic 
Csharp :: save binary data to file c# 
Csharp :: matrix transpose 
Csharp :: or operator in c# 
Csharp :: f# get last element of list 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =