filesystemobject

A

abcd

from ASP.NET program how can I check the file existance and get properties
of a file on a system....do .net use the same FileSystemObject or are there
other .NET calls availbe to work equivalent to FileSystemObject
capability...

thanks
 
T

Teemu Keiski

K

Kevin Spencer

Use the System.IO NameSpace classes. Specifically, you'll be interested in
the File, Directory, FileInfo, and DirectoryInfo classes. See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemio.asp

or, better yet, get your own free copy of the Microsoft .Net SDK from:

http://www.microsoft.com/downloads/...A6-3647-4070-9F41-A333C6B9181D&displaylang=en

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
A

abcd

Teemu thanks.

I am still in classASP world...I need to improve my .NET skills asap and get
familiar with the namespaces....

cheers !
 
A

abcd

can this check for netowrk file

like

Dim fileExists As Boolean =
System.IO.File.Exists("\\msnt102\shared\file.txt")
If fileExists Then...
'Do something with the file
Else
'File does not exist
End if

this code didnt work...I tried mapping that drive too like

Dim fileExists As Boolean = System.IO.File.Exists("x:\shared\file.txt")

are there any special permissions required....any thoughts
 
C

Curt_C [MVP]

abcd said:
can this check for netowrk file

like

Dim fileExists As Boolean =
System.IO.File.Exists("\\msnt102\shared\file.txt")
If fileExists Then...
'Do something with the file
Else
'File does not exist
End if

this code didnt work...I tried mapping that drive too like

Dim fileExists As Boolean = System.IO.File.Exists("x:\shared\file.txt")

are there any special permissions required....any thoughts


it should as long as the user that IIS is running under has that drive
mapped or has permission to the server/share
 
A

abcd

This is something configutation issue. I have many such machines which will
have mdb files and I want to access those from my ASP.NET application

Machine A is IIS, ASP.NET application
Machine B,C,D,E,......Z has some files shared....

does that mean that I need toc reate IUSR_A, on each of the machine
B,C,D,E....Z and have that user give permissions....

thanks
 
C

Curt_C [MVP]

abcd said:
This is something configutation issue. I have many such machines which will
have mdb files and I want to access those from my ASP.NET application

Machine A is IIS, ASP.NET application
Machine B,C,D,E,......Z has some files shared....

does that mean that I need toc reate IUSR_A, on each of the machine
B,C,D,E....Z and have that user give permissions....

huh? Are they all accessing these from the same website/page? If so
that's the IIS user machine I'm talking about...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top