Ohh, ok. Here is one way to get it:
http://pinvoke.net/default.aspx/shell32.SHGetFileInfo
Basically, you P/Invoke SHGetFileInfo() shell API.
"CLEAR-RCIC" <CL*******@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
I'm don't think you understand the code I posted. f.type doesn't return the
file extension. f.type returns the type of file that it is. For example:
ASP File
ASPX File
HTML Document
JScript Script File
Text Document
For a better look...put this code into an ASP file in a virtural directory
that has some other files in it and look at the output.
<%
dim fs, fld, f
set fs = server.createobject("Scripting.FileSystemObject")
set fld = fs.GetFolder(server.mappath("."))
for each f in fld.files
response.write f.type
response.write "<br>"
next
%>
"John Timney ( MVP )" wrote:
Assuming you mean the extension of a file you can use the fileinfo class
http://msdn.microsoft.com/library/de...ClassTopic.asp
It has a method GetExtension
http://msdn.microsoft.com/library/de...nsiontopic.asp
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
"CLEAR-RCIC" <CL*******@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com... In the old days, you could get a file type in ASP by doing:
dim fs, fld, f
set fs = server.createobject("Scripting.FileSystemObject")
set fld = fs.GetFolder(server.mappath(sCurrentDir))
for each f in fld.subfolders
f.type
next
How do you get a file type in .Net?