Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need to clarify Pin
Steve Echols23-Sep-08 17:42
Steve Echols23-Sep-08 17:42 
QuestionXML Pin
CodingYoshi23-Sep-08 15:27
CodingYoshi23-Sep-08 15:27 
AnswerRe: XML Pin
N a v a n e e t h23-Sep-08 17:35
N a v a n e e t h23-Sep-08 17:35 
GeneralRe: XML Pin
CodingYoshi24-Sep-08 3:58
CodingYoshi24-Sep-08 3:58 
GeneralRe: XML Pin
N a v a n e e t h24-Sep-08 6:55
N a v a n e e t h24-Sep-08 6:55 
AnswerRe: XML Pin
Mark Churchill23-Sep-08 23:03
Mark Churchill23-Sep-08 23:03 
QuestionFTPWebRequest... Pin
Jacob Dixon23-Sep-08 13:57
Jacob Dixon23-Sep-08 13:57 
AnswerRe: FTPWebRequest... Pin
J$23-Sep-08 14:41
J$23-Sep-08 14:41 
I ran a quick test and this seemed to work for me.
string path = "c:\\documents and settings\\administrator\\";
bool exists = System.IO.Directory.Exists(path);

// Returns true as this is a directory that exists on my system
MessageBox.Show("This path is a directory:  " + exists.ToString());

Using the same code above, but adding a file name to the path variable:
string path = "c:\\documents and settings\\administrator\\somefile.txt";
bool exists = System.IO.Directory.Exists(path);

// Returns false as this is not a directory that exists on my system, but it is a file
MessageBox.Show("This path is a directory:  " + exists.ToString());


So if you have a string that you are certain contains either a full file name or a directory path, you should be able to determine if it is a directory or not using System.IO.Directory.Exists(path);
GeneralRe: FTPWebRequest... Pin
Jacob Dixon23-Sep-08 15:01
Jacob Dixon23-Sep-08 15:01 
GeneralRe: FTPWebRequest... Pin
J$23-Sep-08 15:11
J$23-Sep-08 15:11 
GeneralRe: FTPWebRequest... Pin
Jacob Dixon23-Sep-08 15:23
Jacob Dixon23-Sep-08 15:23 
AnswerRe: FTPWebRequest... Pin
Mark Salsbery24-Sep-08 9:26
Mark Salsbery24-Sep-08 9:26 
GeneralRe: FTPWebRequest... Pin
Jacob Dixon25-Sep-08 15:13
Jacob Dixon25-Sep-08 15:13 
GeneralRe: FTPWebRequest... Pin
Mark Salsbery25-Sep-08 15:36
Mark Salsbery25-Sep-08 15:36 
QuestionCrystal Report HELP.. Pin
Slick6923-Sep-08 13:48
Slick6923-Sep-08 13:48 
QuestionSave my time! Pin
Pedram Behroozi23-Sep-08 11:28
Pedram Behroozi23-Sep-08 11:28 
AnswerRe: Save my time! Pin
Wendelius23-Sep-08 11:39
mentorWendelius23-Sep-08 11:39 
AnswerRe: Save my time! Pin
MarkB77723-Sep-08 11:40
MarkB77723-Sep-08 11:40 
GeneralRe: Save my time! Pin
Wendelius23-Sep-08 11:43
mentorWendelius23-Sep-08 11:43 
GeneralRe: Save my time! Pin
Pedram Behroozi23-Sep-08 12:20
Pedram Behroozi23-Sep-08 12:20 
GeneralRe: Save my time! [modified] Pin
Pedram Behroozi23-Sep-08 12:25
Pedram Behroozi23-Sep-08 12:25 
GeneralRe: Save my time! Pin
PIEBALDconsult23-Sep-08 16:21
mvePIEBALDconsult23-Sep-08 16:21 
GeneralRe: Save my time! Pin
Wendelius23-Sep-08 18:13
mentorWendelius23-Sep-08 18:13 
GeneralRe: Save my time! Pin
PIEBALDconsult23-Sep-08 16:18
mvePIEBALDconsult23-Sep-08 16:18 
AnswerRe: Save my time! Pin
J$23-Sep-08 14:22
J$23-Sep-08 14:22 

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.