.NET
  Home arrow .NET arrow Page 4 - 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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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 - Public Methods with File Class


    (Page 4 of 8 )

    Some of the Public Methods used with File class is as follows:

    • AppendText
    • Copy
    • Create
    • CreateText
    • Delete
    • Exists
    • GetAttributes
    • GetCreationTime
    • GetCreationTimeUtc
    • GetLastAccessTime
    • GetLastAccessTimeUtc
    • GetLastWriteTime
    • Move
    • Open
    • OpenRead
    • OpenText
    • OpenWrite
    • SetAttributes
    • SetCreationTime
    • SetCreationTimeUtc
    • SetLastAccessTime
    • SetLastAccessTimeUtc
    • SetLastWriteTime
    • SetLastWriteTimeUtc

    Usage:

    ‘  Initializing File class aids in the creation of FileStream objects

    Try
     Dim strMyPath As String=”C:\Benoy\temp.txt”
     Dim strMyCopyPath As String = _
      “C:\Benoy\temp1.txt”
     Dim objFS As FileStream = _ File.Create(strMyPath)
     
     ‘ Closing the file
     objFS.Close
     
     ‘ Copy the file
     File.Copy(strMyPath,strMyCopyPath
     ‘ Delete the file
     File.Delete(strMyPath)

    Catch
     MessageBox.Show(“Error in File Operation”)
    End Try

    10. The class FileInfo provides the same file management operation as in File class such as Creating, Opening, Deleting, Copying and Moving of files using FileStream objects, except if you are not reusing the object several times because the security check is not always necessary.

    11. The class FileLoadException throws exception error if any error occurs during File Load.

    Some of the public methods used with this class are shown below:

    • FileName – The associated filename that causes exception.
    • FusionLog – Get the log file.
    • HelpLink - Help Link association during exception error.
    • InnerException – An inner exception that caused the current exception.
    • Message - Exception Error Message.
    • Source – Error Source.
    • StackTrace – The associated string representation of the frames on the call stack.
    • TargetSite – The associated method name that causes exception.

    12. The FileNotFoundException class throws the exception error when the associated file is not found in the specified path or invalid disk access. The public methods are same as FileLoadException class.

    More .NET Articles
    More By Benoyraj Baskaran


     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT