| | |
Finding file size
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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 add arithmetic array assignment basic binary bing box button buttons center check code combobox component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel file-dialog firewall folder ftp google hardcopy image images isnumericfuntioncall login math memory mobile ms mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox1 port print printpreview problemwithinstallation project record reports" reuse save savedialog searchbox serial soap storedprocedure string tcp temp text textbox timer toolbox trim updown useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





