How to check if a folder exists?

  • Автор темы Автор темы nova
  • Дата начала Дата начала

nova

Client
Регистрация
09.10.2011
Сообщения
88
Реакции
7
Баллы
8
How to check if a folder exists?

Thanks
 
I only see option for checking if file exists but not checking if folder exists. would i need to figure out how to do it with c# ?
 
Hi.

Take this:

C#:
Развернуть Свернуть Копировать
if(Directory.Exists(project.Variables["dirPath"].Value))
    throw new Exception("Directory exist");

Create variable dirPath.
If directory will exist it will go out to bad exit.
 
how do i use it. im having trouble. im not good with c#
Hi.

Take this:

C#:
Развернуть Свернуть Копировать
if(Directory.Exists(project.Variables["dirPath"].Value))
    throw new Exception("Directory exist");

Create variable dirPath.
If directory will exist it will go out to bad exit.
 

Вложения

thanks so much. I didn't check "Do not return a value" that was my mistake.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)