| | |
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 |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





