Check that file exists: Difference between revisions
Content added Content deleted
(→[[Toka]]: Added VB) |
(→[[Visual Basic .NET]]: formatting) |
||
Line 172: | Line 172: | ||
'Current Directory |
'Current Directory |
||
If |
Console.WriteLine(If(IO.Directory.Exists("docs"), "directory exists", "directory doesn't exists")) |
||
Console.WriteLine(IIf(IO.Directory.Exists("output.txt"), "file exists", "file doesn't exists")) |
|||
'Root |
'Root |
||
Console.WriteLine(IIf(IO.Directory.Exists("\docs"), "directory exists", "directory doesn't exists")) |
|||
Console.WriteLine(IIf(IO.Directory.Exists("\output.txt"), "file exists", "file doesn't exists")) |
|||
'Root, platform independent |
'Root, platform independent |
||
If |
Console.WriteLine(If(IO.Directory.Exists(IO.Path.DirectorySeparatorChar & "docs"), _ |
||
"directory exists", "directory doesn't exists")) |
|||
If |
Console.WriteLine(If(IO.Directory.Exists(IO.Path.DirectorySeparatorChar & "output.txt"), _ |
||
"file exists", "file doesn't exists")) |