473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Question about FileAttributes Enumeration

Quoting from MSDN docu:

"This enumeration has a FlagsAttribute attribute that allows a bitwise
combination of its member values"

I don't get it, how can I check if FileSystemInfo.Attribute has the
Hidden and System attribute, or maybe only one of those?

Edgardo
Nov 17 '05 #1
1 1263

"Edgardo Rossetto" <no@gracias.com> wrote in message
news:uw**************@TK2MSFTNGP14.phx.gbl...
Quoting from MSDN docu:

"This enumeration has a FlagsAttribute attribute that allows a bitwise
combination of its member values"

I don't get it, how can I check if FileSystemInfo.Attribute has the Hidden
and System attribute, or maybe only one of those?


Its obnoxiously designed really, although logical. You have to use the
bitwise and operator(&) and a comparison

if ((fsi.Attribute & FileAttributes.Hidden) != 0)
{
//FileAttributes.Hidden is set
}

and so on.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Wright | last post by:
I know that I can set up an enumeration as follows ( just typed in quick so may have syntax errors ): <xsd:simpleType name="colors"> <xsd:restriction base="xsd:string"> <xsd:enumeration...
3
by: raffelm | last post by:
Say I have an enum private enum ShippingMethods { smSnailMail, smEmail } If create var of type ShippingMethods when I call ToString() on it, I get the actual enumeration. I would like to...
1
by: Frank | last post by:
Help My Brain is apparently not working! I have been trying to toggle FileAttributes in C# code to no avail. Nothing I have tried has worked and I have been unable to find anything anywhere...
16
by: dev | last post by:
Hello, How can the following code be converted to VB.Net? I am mostly interested in how to handle the StrPtr calls in the function. Private Declare Function PathRelativePathToW Lib...
13
by: poison.summer | last post by:
Hello If I have an enum definition for instance typedef enum { F0 = 0, F1 = 1, F2 = 2, F3 =3
37
by: mdh | last post by:
In one of the answers to a K&R exercise, the first couple of lines are: enum loop { NO, YES}; enum loop okloop=YES; I get the first line, but not the second. Sorry about the LOL question. ...
1
by: mgonzales3 | last post by:
I'm trying to compare DirectoryInfo.Attributes to FileAttributes like so: // result returning // Directory | Archive DirectoryInfo info = new DirectoryInfo(this.folderFullName); if...
1
by: brucepickford001 | last post by:
Hi, I have a not simple problem. I want the following XML to be schema valid <PopulationDemographic> <PersonName>Joe Blogs</PersonName> <Age>2</Age> <Category>baby</Category>...
13
by: At_sea_with_C | last post by:
Consider the following code: #include <stdio.h> #define SOMEVAL 1234 enum tree_types { PINE = 10, BIRCH, LARCH, OAK = 100, MAPLE, ELM, WILLOW }; void print_val(enum tree_types tree) {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.