Click here to Skip to main content
15,921,959 members
Home / Discussions / C#
   

C#

 
GeneralRe: Down Arrow Key Pin
Umair Ahmad khan15-Jan-05 20:21
Umair Ahmad khan15-Jan-05 20:21 
GeneralRe: Down Arrow Key Pin
Umair Ahmad khan16-Jan-05 4:26
Umair Ahmad khan16-Jan-05 4:26 
GeneralRe: Down Arrow Key Pin
Peter Molnar16-Jan-05 10:45
Peter Molnar16-Jan-05 10:45 
GeneralOdd Exception in Event :: Help!?!?! Pin
flip_trickle15-Jan-05 7:31
flip_trickle15-Jan-05 7:31 
GeneralRe: Odd Exception in Event :: Help!?!?! Pin
Robert Rohde15-Jan-05 7:51
Robert Rohde15-Jan-05 7:51 
GeneralRe: Odd Exception in Event :: Help!?!?! Pin
flip_trickle15-Jan-05 8:30
flip_trickle15-Jan-05 8:30 
GeneralRe: Odd Exception in Event :: Help!?!?! Pin
flip_trickle15-Jan-05 8:32
flip_trickle15-Jan-05 8:32 
GeneralSystem.IO file/directory syntax question... Pin
new_phoenix15-Jan-05 7:04
new_phoenix15-Jan-05 7:04 
I would like to make changes to files that are stored in a specific windows directory for my application, and I know that it would require the usage of the foreach loop, but I do not know how to apply the syntax of how to access the files in the directory.

Here is what I think is the correct syntax. Please correct me. The error message is that it "cannot convert type string to System.IO.File".

using System.IO;

dirDirectory = "C:/directorypath/";
foreach (File fileName in Directory.GetFiles(dirDirectory))
{
fileName.
... processing (need to access the properties of each file)
}

Would appreciate assistance in establishing the correct syntax. While I realize that the foreach loop requires a specific file/control to evaluate and a collection of files/controls to follow the IN word, it doesn't seem to work here. It would seem to me that the GetFiles() method is a collection and should work. Why doesn't it?

The typical syntax is:

foreach (Control control in this.Controls)
{
... processing
}
GeneralRe: System.IO file/directory syntax question... Pin
Robert Rohde15-Jan-05 7:55
Robert Rohde15-Jan-05 7:55 
GeneralRe: System.IO file/directory syntax question... Pin
new_phoenix15-Jan-05 8:14
new_phoenix15-Jan-05 8:14 
GeneralSqlite C# Pin
Adnan Siddiqi15-Jan-05 6:08
Adnan Siddiqi15-Jan-05 6:08 
GeneralRe: Sqlite C# Pin
Robert Rohde15-Jan-05 6:59
Robert Rohde15-Jan-05 6:59 
Questionhow to create an ms installer Pin
basbous15-Jan-05 6:07
basbous15-Jan-05 6:07 
Generalhelp needed Pin
prasanna_ids15-Jan-05 1:08
prasanna_ids15-Jan-05 1:08 
GeneralOutlook popup message Pin
Osmosys14-Jan-05 21:57
Osmosys14-Jan-05 21:57 
GeneralRe: Outlook popup message Pin
Heath Stewart18-Jan-05 6:09
protectorHeath Stewart18-Jan-05 6:09 
GeneralRe: Outlook popup message Pin
Anonymous19-Jan-05 2:09
Anonymous19-Jan-05 2:09 
GeneralVideo Broadcasting problems Pin
RockRock14-Jan-05 19:13
RockRock14-Jan-05 19:13 
GeneralKernel Level Files *Please Help!* Pin
kshet2614-Jan-05 14:54
kshet2614-Jan-05 14:54 
GeneralRe: Kernel Level Files *Please Help!* Pin
Alex Korchemniy14-Jan-05 18:09
Alex Korchemniy14-Jan-05 18:09 
GeneralEnsuring text is always readable against background... Pin
Member 9614-Jan-05 14:09
Member 9614-Jan-05 14:09 
GeneralRe: Ensuring text is always readable against background... Pin
leppie14-Jan-05 19:14
leppie14-Jan-05 19:14 
GeneralRe: Ensuring text is always readable against background... Pin
Robert Rohde14-Jan-05 21:30
Robert Rohde14-Jan-05 21:30 
GeneralRe: Ensuring text is always readable against background... Pin
mav.northwind14-Jan-05 21:24
mav.northwind14-Jan-05 21:24 
GeneralFinal result.. Pin
Member 9615-Jan-05 6:05
Member 9615-Jan-05 6:05 

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.