Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Search Stardeveloper.com
Newsletter
Enter your email address to receive full length articles at Stardeveloper:


Article Categories
.NET  .NET
  ASP (16)
  ASP.NET (43)
  ADO (16)
  ADO.NET (11)
  COM (6)
  Web Services (4)
  C# (1)
  VB.NET (3)
  IIS (2)

J2EE  J2EE
  JSP (15)
  Servlets (9)
  Web Services (1)
  EJB (4)
  JDBC (4)
  E-Commerce (1)
  J2ME (1)
  Products (1)
  Applets (1)
  Patterns (1)

Main Category  Other
  Website Maintenance (3)
Log In
UserName Or Email:

Password:

Auto-Login:

Hosted by Securewebs.com
 
Home : .NET : ASP : Working with Drives, Folders and Files in ASP
 
Read full length articles at Stardeveloper using Twitter Follow on Twitter Facebook Facebook fan page Email Get Articles via Email RSS Get Articles via RSS Feed

Properties and Methods of File Object
Properties of File.

Property Description
Attributes Returns attributes for the file which may be Normal(0), ReadOnly(1), Hidden(2), System(4), Volume(name)(8), Directory(File)(16), Archive(32), Alias(64) or Compressed(128).
DateCreated Returns date and time when file was created.
DateLastAccessed Returns date and time when file was last accessed.
DateLastModified Returns date and time when file was last modified.
Drive Returns Drive object where the file resides.
Name Sets or returns name of the file.
ParentFolder Returns Folder object for the parent folder of this file.
Path Returns complete path for the file.
ShortName Returns DOS style 8.3 version of file name.
ShortPath Returns DOS style 8.3 version of file path.
Size Returns size of the file in bytes.
Type Returns a descriptive string for the current file.

Methods of File.

Method Description
Copy(destination, overwrite) Copies this file to destination.
Delete(force) Deletes the current file.
Move(destination) Moves the file to destination.
CreateTextFile(name, overwrite, unicode) Creates a new text file under the current folder and returns a TextStream object for this file. If overwrite argument is True then existing file with same name is deleted. unicode argument is optional.
OpenAsTextStream(iomode, format) Opens a file for reading(1), writing(2) or appending(8) and returns a TextStream object for this file.

Properties and Methods of TextStream Object
Properties of TextStream.

Property Description
AtEndOfLine Returns True if file pointer is at the end of line.
AtEndOfStream Returns True if file pointer is at the end of file.
Column Returns column number for the current character in the file starting from 1.
Line Returns current line number within the file starting from 1.

Methods of TextStream.

Method Description
Close() Closes the open file.
Read(numOfCharacters) Reads specified number of characters from a file.
ReadAll() Reads the content of the file and returns a single string.
ReadLine() Reads one line of the file.
Skip(numOfCharacters) Skips through the numOfCharacters when reading through a file.
SkipLine() Skips the current line and moves to the next line.
Write(string) Writes given string to the file.
WriteLine(string) Writes a string and appends new line character after it.
WriteBlankLines(number) Writes number of new line characters to the file.

Previous ( 3 Gone )( No Further Pages )

Download Associated Files
2001050301.zip

Comments/Questions ( Threads: 26, Comments: 39 )
    Contains 1 or more replies by the Author of this Article.
    Contains 1 or more replies by Faisal Khan.

  1. Copy images in Access on to the hard disk
  2. plz help me
  3. Determined folder of the drive D
  4. Urgent!! problem with listing files ( 1 Reply )
  5. Trouble Accessing DLL files Thru ASP
  6. Need assistance with directory creation please.... ( 1 Reply )
  7. Permission to Folder
  8. Not able to read contents from file.
  9. How to read/write a textfile; coding in Windows XP/IIS
  10. Web Drive
  11. Network Drives
  12. Want to display files in a folder sorted by date created? ( 2 Replies )
  13. Listing Folders in Dropdown menu ( 1 Reply )
  14. Is Great!
  15. display folders within folders
  16. it doesnt work?
  17. Permission Denied on root of C drive
  18. This is great stuff ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  19. Attach a file to an Email From Database
  20. adding/creating a new folder ( 2 Replies )
  21. Disk is not ready??
  22. error with getfolder method ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  23. Errors using IIS in Windows 2000 Professional ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  24. filesysytem objects ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  25. How to read a delimeted(delimeter ||) text file ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  26. Exactly what I was looking for ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.

Post Comments/Questions

In order to post questions/comments, you must be logged-in. If you are not a member yet, then signup, otherwise login. Once you login then come back to this page and you'll see a form right here which will allow you to post comments/questions.

Please note, one of the benefits of signing up is to be notified immediately by email everytime you receive a reply to the thread you have subscribed.

 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.