Finding file size

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 63
Reputation: bcm is an unknown quantity at this point 
Solved Threads: 0
bcm's Avatar
bcm bcm is offline Offline
Junior Poster in Training

Finding file size

 
0
  #1
Sep 12th, 2007
Can any one give me code for finding size of my log file using VB.NET????
Also I want the code to make my log file of 1KB only and not more than that.
BCM
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3
Reputation: melvincmathew is an unknown quantity at this point 
Solved Threads: 0
melvincmathew melvincmathew is offline Offline
Newbie Poster

Re: Finding file size

 
0
  #2
Nov 19th, 2007
Originally Posted by bcm View Post
Can any one give me code for finding size of my log file using VB.NET????
Also I want the code to make my log file of 1KB only and not more than that.

I want vb.net code for getting file size for a particular log file and delete data based on date if the file size exceeds the limit.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3
Reputation: melvincmathew is an unknown quantity at this point 
Solved Threads: 0
melvincmathew melvincmathew is offline Offline
Newbie Poster

Re: Finding file size

 
0
  #3
Nov 19th, 2007
please send me the code for the above mentioned one..
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 9
Reputation: MehdiAnis is an unknown quantity at this point 
Solved Threads: 0
MehdiAnis MehdiAnis is offline Offline
Newbie Poster

Re: Finding file size

 
0
  #4
Nov 19th, 2007
To Get File Size:
=============

Imports System.IO

Private Function GetFileSize(ByVal MyFilePath As String) As Long
Dim MyFile As New FileInfo(MyFilePath)
Dim FileSize As Long = MyFile.Length
Return FileSize
End Function


DELETE COMMAND:
============
MyFile.Delete()

Make sure the file is not ReadOnly, AlreadyInUse B4 deleting, or u get exception.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3
Reputation: melvincmathew is an unknown quantity at this point 
Solved Threads: 0
melvincmathew melvincmathew is offline Offline
Newbie Poster

Re: Finding file size

 
0
  #5
Nov 20th, 2007
Thanks for the code

I need the code for opening the file and deleting based on date..

please help me.. the other code was really helpfull..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC