[ tomislav91 @ 07.06.2015. 11:27 ] @
Umesto da i njega ostavi, samo da doda (1), on ne uradi nista, ne izbaci mi ni exception ni nista...
U cemu je problem? On bi treba recimo, ako imam folder Test, da skonta e, postoji taj folder, hoces da sacuvas oba, ako da, on treba da sacuva Test (1).
Sa fajlovima mi sve funkcionise, ali sa folderom ne, u cemu je problem, tj gde je u kodu?

Code:

 If System.IO.Directory.Exists(destinationFolderPath) Then
                        Dim nextAvialableFolderPath As String = GetDestinationFolderPath(txtFolderNetworkPath.Text, System.IO.Path.GetDirectoryName(originalFolderPath))
                    Select Case MessageBox.Show("Fajl vec postoji. Hoces li da zamenis(yes) ili da sacuvas oba (no) ili da prekines operaciju (Close)", "Greska", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
                   

                        Case Windows.Forms.DialogResult.No


                            My.Computer.FileSystem.CopyDirectory(originalFolderPath, nextAvialableFolderPath)






a evo i funkcije
Code:


    Private Function GetDestinationFolderPath(location As String, folderName As String)
        Dim counter As Integer = 0
        Dim desiredFolderPath As String = System.IO.Path.Combine(location, String.Format("{0}", folderName))

        While System.IO.Directory.Exists(desiredFolderPath)
            counter += 1
            desiredFolderPath = System.IO.Path.Combine(location, String.Format("{0} ({1})", folderName, counter.ToString))
        End While
        Return desiredFolderPath
    End Function