Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Size File
Message
 
To
06/03/2006 15:31:30
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01101822
Message ID:
01101855
Views:
10
Daniel,
Take a look at the FileInfo.Length property in the M$ docs. Here is some code to get you started (copied from the M$ docs):
// The following example displays the names and sizes
// of the files in the specified directory.
using System;
using System.IO;

public class FileLength
{
    public static void Main()
    {
        // Make a reference to a directory.
        DirectoryInfo di = new DirectoryInfo("c:\\");
        // Get a reference to each file in that directory.
        FileInfo[] fiArr = di.GetFiles();
        // Display the names and sizes of the files.
        Console.WriteLine("The directory {0} contains the following files:", di.Name);
        foreach (FileInfo f in fiArr)
            Console.WriteLine("The size of {0} is {1} bytes.", f.Name, f.Length);
    }
}
>Hi
>
>How i Make to obtain size file with c#.
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform