Click here to Skip to main content
15,917,579 members
Home / Discussions / C#
   

C#

 
QuestionReading Excel Date - Strange Value Pin
Kevin Marois19-Oct-09 6:49
professionalKevin Marois19-Oct-09 6:49 
AnswerRe: Reading Excel Date - Strange Value Pin
Richard MacCutchan19-Oct-09 8:54
mveRichard MacCutchan19-Oct-09 8:54 
Questionmenu with directx Pin
behzadcp19-Oct-09 6:02
professionalbehzadcp19-Oct-09 6:02 
AnswerRe: menu with directx Pin
Christian Graus19-Oct-09 10:17
protectorChristian Graus19-Oct-09 10:17 
QuestionTest directory is empty Pin
abbd19-Oct-09 6:00
abbd19-Oct-09 6:00 
AnswerRe: Test directory is empty Pin
N a v a n e e t h19-Oct-09 6:09
N a v a n e e t h19-Oct-09 6:09 
AnswerRe: Test directory is empty Pin
stancrm19-Oct-09 6:11
stancrm19-Oct-09 6:11 
AnswerRe: Test directory is empty Pin
Luc Pattyn19-Oct-09 6:56
sitebuilderLuc Pattyn19-Oct-09 6:56 
Hi,

before .NET 4.0:

the easiest way is testing Directory.GetFileSystemEntries().Length==0 as this method returns the names of all files and folders.

and yes it is a pity you have to ask for a potentially huge array of data just to get a true/false result.

the alternative is to use P/Invoke and use FindFirstFile (not sure if and how that works for subdirectories).


since .NET 4.0 there are new siblings to GetFileSystemEntries and the like (see EnumerateFileSystemEntries) that return results only one at a time and don't burden the CPU and memory that much, as you can opt out right away.

Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages

Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.


Questiontransfer files from aclient to another using socket programming+c#? Pin
anabina19-Oct-09 5:46
anabina19-Oct-09 5:46 
AnswerRe: transfer files from aclient to another using socket programming+c#? Pin
N a v a n e e t h19-Oct-09 6:02
N a v a n e e t h19-Oct-09 6:02 
AnswerRe: transfer files from aclient to another using socket programming+c#? Pin
stancrm19-Oct-09 6:13
stancrm19-Oct-09 6:13 
QuestionReading Data from a CD Pin
AndyASPVB19-Oct-09 5:28
AndyASPVB19-Oct-09 5:28 
AnswerRe: Reading Data from a CD Pin
stancrm19-Oct-09 6:12
stancrm19-Oct-09 6:12 
GeneralRe: Reading Data from a CD Pin
AndyASPVB19-Oct-09 8:44
AndyASPVB19-Oct-09 8:44 
GeneralRe: Reading Data from a CD Pin
Richard MacCutchan19-Oct-09 8:57
mveRichard MacCutchan19-Oct-09 8:57 
QuestionFormat SQL statement into C# string. Pin
RK KL19-Oct-09 5:15
RK KL19-Oct-09 5:15 
AnswerRe: Format SQL statement into C# string. Pin
Not Active19-Oct-09 5:51
mentorNot Active19-Oct-09 5:51 
GeneralRe: Format SQL statement into C# string. Pin
RK KL19-Oct-09 6:01
RK KL19-Oct-09 6:01 
GeneralRe: Format SQL statement into C# string. Pin
Not Active19-Oct-09 6:17
mentorNot Active19-Oct-09 6:17 
GeneralRe: Format SQL statement into C# string. Pin
RK KL19-Oct-09 7:01
RK KL19-Oct-09 7:01 
GeneralRe: Format SQL statement into C# string. Pin
Not Active19-Oct-09 7:19
mentorNot Active19-Oct-09 7:19 
GeneralRe: Format SQL statement into C# string. Pin
EliottA19-Oct-09 8:17
EliottA19-Oct-09 8:17 
GeneralRe: Format SQL statement into C# string. Pin
RK KL19-Oct-09 9:06
RK KL19-Oct-09 9:06 
GeneralRe: Format SQL statement into C# string. Pin
Not Active19-Oct-09 9:19
mentorNot Active19-Oct-09 9:19 
GeneralRe: Format SQL statement into C# string. Pin
RK KL19-Oct-09 9:25
RK KL19-Oct-09 9:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.