Check that file exists: Difference between revisions
Content added Content deleted
No edit summary |
(→[[Toka]]: Added VB) |
||
Line 163: | Line 163: | ||
" docs" exists? . |
" docs" exists? . |
||
" /docs" exists? . |
" /docs" exists? . |
||
==[[Visual Basic .NET]]== |
|||
[[Category:Visual Basic .NET]] |
|||
'''Platform:''' [[.NET]] |
|||
'''Language Version:''' 9.0+ |
|||
'Current Directory |
|||
If IO.Directory.Exists("docs") Then Console.WriteLine("directory exists") Else Console.WriteLine("directory doesn't exists") |
|||
If IO.Directory.Exists("output.txt") Then Console.WriteLine("file exists") Else Console.WriteLine("file doesn't exists") |
|||
'Root |
|||
If IO.Directory.Exists("\docs") Then Console.WriteLine("directory exists") Else Console.WriteLine("directory doesn't exists") |
|||
If IO.Directory.Exists("\output.txt") Then Console.WriteLine("file exists") Else Console.WriteLine("file doesn't exists") |
|||
'Root, platform independent |
|||
If IO.Directory.Exists(IO.Path.DirectorySeparatorChar & "docs") Then Console.WriteLine("directory exists") Else Console.WriteLine("directory doesn't exists") |
|||
If IO.Directory.Exists(IO.Path.DirectorySeparatorChar & "output.txt") Then Console.WriteLine("file exists") Else Console.WriteLine("file doesn't exists") |