Avatar of altariamx2003
altariamx2003
Flag for Mexico asked on

detect the size of a file when it is copied to a external device

I would like to know if you have an example of perhaps an advice about how to detect the size of a file when it is copied to an external device like a usb or external hard disk.

Best regards
ProgrammingVisual Basic.NET.NET Programming

Avatar of undefined
Last Comment
altariamx2003

8/22/2022 - Mon
AndyAinscow

As it is the same size as that on your local hard disc (because copy isn't changing the file contents) maybe you ought to rethink your question.  You want something but it isn't clear what you want to know.
teebon

You can determine the file size by using fileinfo. code example
SOLUTION
teebon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Tapan Pattanaik

Hi altariamx2003,

Public Class  FileSize
    Public Shared Sub Main
   
        Dim fileDetails As IO.FileInfo


        fileDetails = My.Computer.FileSystem.GetFileInfo("test.txt")

        Console.WriteLine("Size: " & fileDetails.Length & " byte(s)")
    End Sub

End Class
Your help has saved me hundreds of hours of internet surfing.
fblack61
altariamx2003

ASKER
You are right AndyAinscow let me try to explain a little better

In this new project I need to do a program that track or monitor if the user plug an external device (usb, external disk drive, etc....) to a computer and try to copy any file  to the external device plugged, the program need to send an internal alert(a email to somebody) about this issue.

I hope this help

I really dont have a clue hehehehe, and i dont know how to start

Any advice will appreciated

Thanks
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Rob G

You can use this too:
http://www.solarwinds.com/log-event-manager.aspx

We use it here,
It works in Windows, Mac, and Linux..
altariamx2003

ASKER
Sorry for the delay
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.