Tuesday 15 April 2014

c# - Get file information on Windows Server 2012 -



c# - Get file information on Windows Server 2012 -

i have next problem context:

web application (webapi 2.0) runs on iis on windows server 2012 the web app receives files (excel spreadsheets) outside (file uploaded) the web app uses module (class library project) in solution processes files, module requires read creation date (e.g. right click file -> details -> origin -> content created field) the fileinfo creationtime not homecoming same thing cannot utilize

i've managed filed using shell32.dll in processing module this:

var shell = new shell32.shell(); var folder = shell.namespace(finfo.directoryname); var file = folder.parsename(finfo.name); datevalue = new string(folder.getdetailsof(file, creationdatedetailindex).trim().where(x => 31 < x && x < 128).toarray()); filecreationdate = datetime.parseexact(datevalue, "m/d/yyyy h:mm tt", cultureinfo.invariantculture);

it works me locally.

but when deploying server datevalue null. i've placed interop.shell32.dll in bin of web application, no luck.

can advise me on how working? maybe different solution utilize of interop.shell32.dll.

c# .net iis asp.net-web-api windows-server-2008

No comments:

Post a Comment