Results 1 to 5 of 5

Thread: [RESOLVED] File Size..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Resolved [RESOLVED] File Size..

    how can i determine the file size and the date it was last modified..

    i need to compare two files and determine which one is the latest and which one is bigger in file size..

    compare a.xml to b.xml..

  2. #2
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: File Size..

    Use FileInfo property...
    VB.Net Code:
    1. 'in method (let say on button click or similar)
    2. Dim aFile As New IO.FileInfo
    3. aFile = My.Computer.FileSystem.GetFileInfo("test.txt") 'you will probably browse this file name and not like this sample, fixed it in code here...
    4. Dim FileSize As Long = aFile.Length
    5. MsgBox(FileSize)
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  3. #3
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: File Size..

    and for date you can use the same property...
    VB.Net Code:
    1. MsgBox("Accessed: " & fileDetail.LastAccessTime)
    2. 'or
    3. MsgBox("Modified: " & fileDetail.LastWriteTime)
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: File Size..

    thanks..

  5. #5
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: File Size..

    np...
    ...please mark this thread resolved.
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width