Get file informations form web URLs

  • Thread starter Thread starter Emanuele Ornella
  • Start date Start date
E

Emanuele Ornella

I used the FileInfo class to obtain informations about files in the
file system.
I would like to have the same informations for a file in a web url, but
I cannot use FileInfo.
I discovered WebClient from the System.Net namespace, but this gives me
a FileStream in return and not a FileInfo.

Any way to convert a FileStream into FileInfo? Or rather any other way
to have these informations?

Thanks in advance,
ema
 
Hello, Emanuele!

EO> I used the FileInfo class to obtain informations about files in the
EO> file system.
EO> I would like to have the same informations for a file in a web url, but
EO> I cannot use FileInfo.
EO> I discovered WebClient from the System.Net namespace, but this gives me
EO> a FileStream in return and not a FileInfo.

EO> Any way to convert a FileStream into FileInfo? Or rather any other way
EO> to have these informations?

You can use UNC path to obtain the same FileInfo. File path will look like
\\server\folder\file.ext

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Hello Vadym,
UNC path? Where can I get it?
The only UNC method I found on DSN is from namespace
System.Data.SqlServerCe !!

ema
 
Emanuele said:
I used the FileInfo class to obtain informations about files in the
file system.
I would like to have the same informations for a file in a web url,
but I cannot use FileInfo.
I discovered WebClient from the System.Net namespace, but this gives
me a FileStream in return and not a FileInfo.

Any way to convert a FileStream into FileInfo? Or rather any other way
to have these informations?

No, there is not. Access via an URL generally doesn't provide any
information about the resource other than a name and possibly a
last-modified date. If you need more information than that, you need more
access than you're going to get via a URL.

-cd
 
No, there is not. Access via an URL generally doesn't provide any
information about the resource other than a name and possibly a
last-modified date. If you need more information than that, you need more
access than you're going to get via a URL.
Thanks!
ema
 
Back
Top