Users Online

· Guests Online: 160

· Members Online: 0

· Total Members: 188
· Newest Member: meenachowdary055

Forum Threads

Newest Threads
No Threads created
Hottest Threads
No Threads created

Latest Articles

C# Program to Check the Information of the File

C# Program to Check the Information of the File

 

 

This is a C# Program to view the information of the file.

Problem Description

This C# Program Views the Information of the File.

Problem Solution

Here the Attributes property that is used returns an enumerated constant that is encoded as enum flags.

Program/Source Code

Here is source code of the C# Program to View the Information of the File. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.

/*
 * C# Program to View the Information of the File
 */
using System;
using System.IO;
class Program
{
    static void Main()
    {
        FileInfo info = new FileInfo("C:\\sri\\srip.txt");
        FileAttributes attributes = info.Attributes;
        Console.WriteLine("Nature(Attribute) of the File : {0}",attributes);
        Console.Read();
    }
}
Program Explanation

This C# program is used to view the information of the file. Here the Attributes property is used to return an enumerated constant that is encoded as enum flags. Print the information of the file.

 
Runtime Test Cases
 
Nature(Attribute) of the File : Archive

 

Comments

No Comments have been Posted.

Post Comment

Please Login to Post a Comment.

Ratings

Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Render time: 0.74 seconds
10,808,781 unique visits