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 7 1321
Hi,
see System.IO.File and System.IO.FileInfo classes http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemiofileclasstopic.asp http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemIOFileInfoClassTopic.asp
For example checking file's existance would be
Dim fileExists As Boolean = System.IO.File.Exists("C:\file.txt")
If fileExists Then...
'Do something with the file
Else
'File does not exist
End if
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU http://blogs.aspadvice.com/joteke
"abcd" <ab**@abcd.com> wrote in message
news:#k*************@TK2MSFTNGP15.phx.gbl... 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
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/de...rfsystemio.asp
or, better yet, get your own free copy of the Microsoft .Net SDK from: http://www.microsoft.com/downloads/d...displaylang=en
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl... 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
Teemu thanks.
I am still in classASP world...I need to improve my .NET skills asap and get
familiar with the namespaces....
cheers !
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:e3**************@TK2MSFTNGP15.phx.gbl... Hi,
see System.IO.File and System.IO.FileInfo classes http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemiofileclasstopic.asp http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfSystemIOFileInfoClassTopic.asp
For example checking file's existance would be
Dim fileExists As Boolean = System.IO.File.Exists("C:\file.txt") If fileExists Then... 'Do something with the file Else 'File does not exist End if
-- Teemu Keiski ASP.NET MVP, AspInsider Finland, EU http://blogs.aspadvice.com/joteke
"abcd" <ab**@abcd.com> wrote in message news:#k*************@TK2MSFTNGP15.phx.gbl... 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
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
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:e3**************@TK2MSFTNGP15.phx.gbl... Hi,
see System.IO.File and System.IO.FileInfo classes http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemiofileclasstopic.asp http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfSystemIOFileInfoClassTopic.asp
For example checking file's existance would be
Dim fileExists As Boolean = System.IO.File.Exists("C:\file.txt") If fileExists Then... 'Do something with the file Else 'File does not exist End if
-- Teemu Keiski ASP.NET MVP, AspInsider Finland, EU http://blogs.aspadvice.com/joteke
"abcd" <ab**@abcd.com> wrote in message news:#k*************@TK2MSFTNGP15.phx.gbl... 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
abcd wrote: 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
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
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
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:e6**************@TK2MSFTNGP14.phx.gbl... abcd wrote: 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
-- Curt Christianson site: http://www.darkfalz.com blog: http://blog.darkfalz.com
abcd wrote: 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...
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Marcelo Rizzo |
last post by:
I am trying to get the name of a file with a specific extension (tmw)
from several different directories. The problem I am having is that
the program stops working on the second pass with an run...
|
by: John Dewbert |
last post by:
*** post for FREE via your newsreader at post.newsfeed.com ***
Hello,
I have trouble passing a folder object (from a FileSystemObject) to a sub
procedure.
Consider the following code:
...
|
by: Wayfarer |
last post by:
Hi,
I've got a freebie hosting mirror of my production personal website
(sounds kinda grandiose, doesn't it?) at http://journeys.webhostme.com/.
At the production website I was using...
|
by: Steve |
last post by:
Hi all,
FileSystemObject question...
I'm trying to check if files exist or not, but the files
are not sitting on the same server as our Intranet.
Basically we have about 5000 photos in a...
|
by: Sean S - Perth, WA |
last post by:
Hi all,
If I create a FileSystemObject Object is it appropriate to reuse it to
perform operations on different files/folders?
Or should I create a new FileSystemObject Object for each file and...
|
by: kermit |
last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or
Javascript on an aspx page.
I added a refrence to the scrrun.dll
I added importing namespaces for 'System.Object',...
|
by: Luis Esteban Valencia |
last post by:
I'm trying to write a little VB.NET script in an ASP.NET web page that will
create folders, move files, etc... pretty much everything you can expect to
do using the FileSystemObject library.
Is...
|
by: G Gerard |
last post by:
Hello
I am using the FileSystemObject to copy files on a computer
Dim MyObject as Object
|
by: nagmvs |
last post by:
hello I have a problem with FileSystemObject in Vb
Suppose i want to declare as
Dim fs As New FileSystemObject, when i type New After that i can't see FileSystemObject in derived DropDownList.
...
|
by: lee123 |
last post by:
why is this so hard to do. i have alot of books that have exaples of how to do these things but when i try the exaples they never work i have a previous post on "copying files" some of the other guys...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |