Solved

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

Posted on 2014-11-27
8
246 Views
Last Modified: 2014-12-03
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
0
Comment
Question by:altariamx2003
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40470024
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.
0
 
LVL 9

Expert Comment

by:teebon
ID: 40470039
You can determine the file size by using fileinfo. code example
0
 
LVL 9

Assisted Solution

by:teebon
teebon earned 150 total points
ID: 40470042
You can also improvise on this
File Activity Tracker
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 40470157
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
0
 

Author Comment

by:altariamx2003
ID: 40470515
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
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 350 total points
ID: 40470519
I think the following is what you want:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx
A FileSystemWatcher.  There are links to examples of the various functions provided by that class.
0
 
LVL 6

Expert Comment

by:Rob G
ID: 40470529
You can use this too:
http://www.solarwinds.com/log-event-manager.aspx

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

Author Comment

by:altariamx2003
ID: 40479892
Sorry for the delay
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question