Working with Files and Directories using ASP.NET
page 1 of 8
Published: 06 Jul 2006
Unedited - Community Contributed
In this article Sanjit describes how to work with files and directories in ASP.NET using C# with the help of code samples.
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 54867/ 131


In our real life applications it is required to read, write, or manipulate files and directories.  The .NET Framework provides a set of classes in the System.IO namespace to allow synchronous and asynchronous reading from and writing to data streams and files.  Before working with files and directories it is essential to make sure that security permissions are set properly on folders and files where you want to write.  The .NET Framework runs all ASP.NET processes under the local ASPNET account.  This account needs to have write permissions to all the folders and files that are being used to write data.  To set permissions of that folder the steps to be followed are: right-click the folder, go to properties, security tab, and then make sure the local ASPNET account has read and write permissions on that folder.  If they do not, add local ASPNET account to the list and give it read and write permissions and then click ok.  In this article I have tried to discuss most of the methods available in the Directory, DirectoryInfo, File and FileInfo classes.  The sample code snippets in this article have been written in C#.

View Entire Article

User Comments

No comments posted yet.

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-28 7:08:50 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search