| | |
Finding file size
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Nov 2007
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
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.
•
•
Join Date: Nov 2007
Posts: 9
Reputation:
Solved Threads: 0
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.
=============
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.
![]() |
Similar Threads
- finding page size (PHP)
- file size (C++)
- File size in C (Win32) (C)
Other Threads in the VB.NET Forum
- Previous Thread: Problem executing function as event from dynamic created linkbuttons
- Next Thread: merging projects
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic box button buttons center check code component connectionstring convert crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel fade file-dialog firewall folder ftp generatetags hardcopy image images input insert intel isnumericfuntioncall math monitor navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project record reports" savedialog searchvb.net select shutdown string survey tcp temp temperature text textbox timer toolbox trim updown user useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





