Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File System Object in asp.net?

Status
Not open for further replies.

motte

Programmer
May 31, 2001
155
US
Hi all,

I am super-new to asp.net, even newer than all here. I am wondering if there is a way to use the filesystem object in asp.net. I keep getting errors when trying to set one. I think it is a very useful object, along with all the collections that comes with it.

If it isn't there, is there something better or anything else that can be used to get at files, folders etc and still be able to do everything that can be done with the FSO?

Mike
 
Oh, you know what Mike? My bad man, I just re-read that article, and they really picked a bad example for that code. They mention that line: "Let's now have a look at how the FileSystemObject object, if it existed..."

so maybe the code they show won't work hte way I thought it would. If i come up with a more stable answer for you, i'll let you know.
:)

jack
 
Check out VS.NET on-line help. Use Search and Look for: FileSystemObject using (no filter). There is FileSystemObject Sample Code there.

Kyle
 
Hey guys, thanks for the info; however, what is vs.net? Is this a domain name out there? All I get is a link to some megs.com. Or do you mean VS.net as a forum on tek-tips?

Mike
 
Are you not using Visual Studio (VS.NET) to develop your applications? If not, what are you using for an coding editor?

Kyle
 
Just at the moment using edit+. I'm a student, and any day now, we'll be getting the software set up for vs.net. but in the meantime, its the stoneage way.

Mike
 
Hey motte,

Here's that that help file suggested that Kyle was talking about:
********************************************************
To create a reference to the Scripting type library (Scrrun.dll)

On the Project menu, click Add Reference, and then click the COM tab.
Choose Microsoft Scripting Runtime from the Component Name list, and then click Select.
You can now use the Object Browser to view the FSO model's objects, collections, properties, methods, events, and constants.

To create a FileSystemObject object

Dimension a variable as type FileSystemObject, as in the following code:
Dim fso As New FileSystemObject

- or -

Use the CreateObject method to create a FileSystemObject object, as in the following code:
fso = CreateObject("Scripting.FileSystemObject")

*******************************************************
Now, this works within VS.NET, so for what you're doing right now I'm guessing that if you just set up the reference to the Scrrun.dll on your page, you should be able to creat the fso in the same way.

Hope this helps,

Jack
 
Hi Motte,

There are many different options for the FileSystemObject. What language are you programming in, VB or C#? What specifically are you trying to do? We will need as much input as possible to try and get you some appropriate information.

Kyle
 
kyledunn & jfrost,

Thanks for the input. I got the filesystemobject to work. Like I said before, its for a class on ASP.net. The class just started last week so there is very little I know about the .net ways. I was just trying to do some things that I could normally do in asp. Thanks for all the input. I appreciate you time. And as of right now, I am on the correct path. I'll probably be posting in the future too (and hopefully answering questions as well).


Mike
 
I did a search on FileSystemObject for this forum and came up w/ this post which is great [2thumbsup], but I was hoping for something a bit more in depth. Here's my situation.

I'm trying to set up a procedure in VB where through the pressing of a button, info is accessed from files and displayed in textboxes {mainly the file name and location}. Use of the FileSystemObject has been mandated. I tried to use the Help feature in Visual Studio to try and code this out, but it's not terribly helpful (the example jfrost10 mentioned is what I found but that doesn't tell me much). Any ideas? JJ [peace]

"Ignorance and prejudice and fear walk hand in hand" - Witch Hunt, by Rush
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top