za pocetak, citaj. bar MSDN. direktorijum ne mozes brisati pre nego sto ga ispraznis
Note This example shows how to use one of the overloaded versions of Delete. For other examples that might be available, see the individual overload topics.
Code:
Imports System
Imports System.IO
Public Class Test
Public Shared Sub Main()
' Specify the directories you want to manipulate.
Dim path As String = "c:\MyDir"
Dim subPath As String = "c:\MyDir\temp"
Try
' Determine whether the directory exists.
If Directory.Exists(path) = False Then
' Create the directory.
Directory.CreateDirectory(path)
End If
' Determine whether the directory exists.
If Directory.Exists(subPath) = False Then
' Create the directory.
Directory.CreateDirectory(subPath)
End If
'This operation will not be allowed because there are subdirectories.
Console.WriteLine("I am about to attempt to delete {0}", path)
Directory.Delete(path, True)
Console.WriteLine("The Delete operation was successful.")
Catch e As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try
End Sub
End Class
Nije važno da stigneš prvi, važno je prvo da stigneš.