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 FileSystemObjec t or are there
other .NET calls availbe to work equivalent to FileSystemObjec t
capability...
thanks 7 1338
Hi,
see System.IO.File and System.IO.FileI nfo classes http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemiofi leclasstopic.as p http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemIOFi leInfoClassTopi c.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.co m> wrote in message
news:#k******** *****@TK2MSFTNG P15.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 FileSystemObjec t or are
there other .NET calls availbe to work equivalent to FileSystemObjec t 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.co m> wrote in message
news:%2******** *******@TK2MSFT NGP15.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 FileSystemObjec t or are there other .NET calls availbe to work equivalent to FileSystemObjec t 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****@aspalli ance.com> wrote in message
news:e3******** ******@TK2MSFTN GP15.phx.gbl... Hi,
see System.IO.File and System.IO.FileI nfo classes http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemiofi leclasstopic.as p http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfSystemIOFi leInfoClassTopi c.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.co m> wrote in message news:#k******** *****@TK2MSFTNG P15.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 FileSystemObjec t or are there other .NET calls availbe to work equivalent to FileSystemObjec t capability...
thanks
can this check for netowrk file
like
Dim fileExists As Boolean =
System.IO.File. Exists("\\msnt1 02\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:\shar ed\file.txt")
are there any special permissions required....any thoughts
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:e3******** ******@TK2MSFTN GP15.phx.gbl... Hi,
see System.IO.File and System.IO.FileI nfo classes http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemiofi leclasstopic.as p http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfSystemIOFi leInfoClassTopi c.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.co m> wrote in message news:#k******** *****@TK2MSFTNG P15.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 FileSystemObjec t or are there other .NET calls availbe to work equivalent to FileSystemObjec t capability...
thanks
abcd wrote: can this check for netowrk file
like
Dim fileExists As Boolean = System.IO.File. Exists("\\msnt1 02\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:\shar ed\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_da rkfalz.com> wrote in message
news:e6******** ******@TK2MSFTN GP14.phx.gbl... abcd wrote: can this check for netowrk file
like
Dim fileExists As Boolean = System.IO.File. Exists("\\msnt1 02\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:\shar ed\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 time error
76. The paths are valid. I tested them and there is a file with the
extension specified.
Any help is appreciated
Marcelo Rizzo
|
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 Scripting.FileSystemObject to get
the date that the file was last modified and to read/write a counter
text file for the number of hits that the whole site had. The freebie
has a kind of half-ass*d FileSystemObject, but it has no GetFile method.
Is there...
|
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 directory on our
database server, and they must stay there. I want to use
the FileSystemObject (running on our Intranet server) to
check if a photo is there, if so display it, if not
|
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 folder?
--
Sean.
| |
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', 'Scripting',
'Scripting.FileSystemObject', and a few others
However, when I try to create the fso object I keep receiving an error.
'ActiveX component can't create object: 'Scripting.FileSystemObject'
|
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 this possible in .NET?
If so, how do I do it?
I've tried:
|
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.
When running my code compiler error coming is like
User defined type not defined.
before projects r running successfully with using FileSystemObject.
|
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 help on this one and i tried to do the same thing with the "movefile" but it never worked as you can see the "filesystemobject" is hard to accomplish for me because this "Movefolder" event falls in this category the code i have i have used for the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |