.NET
  Home arrow .NET arrow Page 3 - Utilize the Full Functionality of the Whid...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Utilize the Full Functionality of the Whidbey File Management
By: Benoyraj Baskaran
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 5
    2004-08-17

    Table of Contents:
  • Utilize the Full Functionality of the Whidbey File Management
  • Classes that Supports System.IO.namespace
  • More Classes and Public Methods
  • Public Methods with File Class
  • FileStream and Other Classes
  • IOException Class and Others
  • System.Security.Permissions
  • Mode, Share and Access of Files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Utilize the Full Functionality of the Whidbey File Management - More Classes and Public Methods


    (Page 3 of 8 )

    Some of the public methods used for Directory class are described as follows.

    • CreateDirectory – Creates a new directory in a specified path.
    • Delete  -  Delete the directory from the specified path
    • Exists – Checks whether the associated directories exists in the specific path
    • GetCreationTime – Get the creation time of directory
    • GetCreationTimeUtc – Get the creation time in universal coordinated time
    • GetCurrentDirectory – Get the current working directory of the application
    • GetDirectories – Gets the name of subdirectories in the working folder
    • GetDirectoryRoot – Get root and volume information for the specified path
    • GetFiles  - Get or returns all the files listed in the specified directory
    • GetFileSytemEntries - Get or returns all the files and sub directories listed in the specified directory
    • GetLastAccessTime – Last access date and time of the specified directory
    • GetLastAccessTimeUtc – Last access date and time of the specified directory in universal coordinator time (UTC) format
    • GetLastWriteTime – Last written date and time of a specified directory
    • GetLastWriteTimeUtc – Last written date and time of a specified directory in universal coordinator time (UTC)
    • GetLogicalDrives – Get all the logical drives on the computer
    • GetParent – Get the absolute and relative path of the parent directory
    • Move – Move the specific directory to another location
    • SetCreationTime – Sets the creation date and time for the specified directory or file
    • SetCreationTimeUtc – Sets the creation date and time for the specified directory or file in universal coordinated time format
    • SetCurrentDirectory – Sets the current directory to a specified directory in an application path
    • SetLastAccessTime - Sets the last access date and time for the specified directory or file

    Usage:

    ‘  Checking whether the directory exists in the specified path

     Dim strMyPath as String = “C:\mySample”

     If Directory.Exists(strMyPath) = True then
           Directory.Delete(strMyPath)
     Else
         Directory.CreateDirectory (strMyPath)
     End if

    5. The class DirectoryInfo used the same functionality as Directory class except if you are not going to reuse an object several times.

    6. The class DirectoryNotFoundException throws exception error when the file or directory  not found in the specified path.

    7. The class EndOfStreamException throws exception error at the past the end of a stream.

    8. The class ErrorEventArgs provides data for Error event.

    Usage:

    ‘  Checking whether the directory exists in the specified path

     Dim strMyPath as String = “C:\mySample”

     ‘ Initializes the “objException” Exception object

     Dim objException as New Exception(“Cannot create Directory”)

     ‘  Creates an ErrorEventArgs with the exception.
     Dim objErrorEventArgs as New ErrorEventArgs(objException)

     If Directory.Exists(strMyPath) = True then
           Directory.Delete(strMyPath)
     Else
         Directory.CreateDirectory (strMyPath)
     End if

     ‘ Retrieves Exception from ErrorEventArgs

     Dim objReturnedException as Exception= objErrorEventArgs.GetException()

     If objReturnedException.Message <> “” then
      MessageBox.Show(objReturnedException.Message
     End if

    End Sub 

    9. The class File provides to manage the file manipulation operations such as Creating, Opening, Deleting, Copying and Moving of files using FileStream objects. File class methods are static.

    More .NET Articles
    More By Benoyraj Baskaran


     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek