Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to retrieve File Information that store in server [modified]

How to retrieve File Information that store in server [modified]

Scheduled Pinned Locked Moved C#
comsysadminxmltutorialannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    germanrose
    wrote on last edited by
    #1

    Dear, -I want to check the version of file then allow to download a updated-file automatically -I had writen a function that allows to retrieve File information using FileInfo and FileVersionInfo -It runs well if the source file 's in my local, but it was not functionly if the source file 's in the server. Ex: http://www.misplacedcomedygroup.com/rss.xml -And it also throws this exception: "URI formats are not supported." Here is my function: //function get version public static string GetFileVersion(string srcFile){ string fileVersion; try { FileVersionInfo info = FileVersionInfo.GetVersionInfo(srcFile); fileVersion = info.FileVersion; } catch (FileNotFoundException e) { throw (e); } } //function get last modify time public static string GetFileLastAccessTime(string srcFile) { string lastAccessTime; try { FileInfo file = new FileInfo(srcFile); lastAccessTime = file.LastAccessTime.ToString(); } catch (FileNotFoundException e) { throw (e); } } Thanks regards, Germanrose -- modified at 0:59 Wednesday 23rd August, 2006

    A 1 Reply Last reply
    0
    • G germanrose

      Dear, -I want to check the version of file then allow to download a updated-file automatically -I had writen a function that allows to retrieve File information using FileInfo and FileVersionInfo -It runs well if the source file 's in my local, but it was not functionly if the source file 's in the server. Ex: http://www.misplacedcomedygroup.com/rss.xml -And it also throws this exception: "URI formats are not supported." Here is my function: //function get version public static string GetFileVersion(string srcFile){ string fileVersion; try { FileVersionInfo info = FileVersionInfo.GetVersionInfo(srcFile); fileVersion = info.FileVersion; } catch (FileNotFoundException e) { throw (e); } } //function get last modify time public static string GetFileLastAccessTime(string srcFile) { string lastAccessTime; try { FileInfo file = new FileInfo(srcFile); lastAccessTime = file.LastAccessTime.ToString(); } catch (FileNotFoundException e) { throw (e); } } Thanks regards, Germanrose -- modified at 0:59 Wednesday 23rd August, 2006

      A Offline
      A Offline
      Anthony Daly
      wrote on last edited by
      #2

      Hey, Just wondering if you still need this, basically you will have to create a webservice/php script to return the information. It should work then. Anthony

      Check out my unit conversion software for Windows - Universal Converter

      Free Toolbar for all your needs! - Universal Converter Toolbar

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups