Skorpion Posted September 17, 2012 Share Posted September 17, 2012 ben Autoplay media studio ile klasör kopyalamayi istiyorum ama bir türlü beceremedim Programlar klasörünü D ye veya belegelerime kopyalamak istiyorum asagidaki kodlari denedim ama olmadi yardimci olabilirmisiniz bana [CODE] File.Install("AutoPlay\\Docs\\Programlar", "D:\\", false, false, nil, nil); File.Copy("AutoPlay\\Docs\\Programlar", "D:\\", true, true, false, true, nil);[/CODE] Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted September 17, 2012 Share Posted September 17, 2012 [font=tahoma,geneva,sans-serif]Ams ile klasör kopyalayabileceğin bir kod yok. Bir ara bu işlem için bir fonksiyon yazmıştım ama her nedense yavaş kopyalıyordu. Vakit bulup düzgün birşeyler yazabilirsem forumda paylaşırım.[/font] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted September 19, 2012 Share Posted September 19, 2012 Çok güzel bir fonksiyon yazmışlar bu iş için:Global Functions: function CopyFolder(sSource, sDestination) local m_sFolder; local m_FoundFolder; local error; --Find all the folders and sub-Folders --results are stored in the table m_tblFolders m_tblFolders = Folder.Find(sSource, "*", true, nil); --if our destination folder does not have the --backslash as the last character, add it if String.Right(sDestination, 1) ~= "\\" then sDestination = sDestination .. "\\"; end --m_tblFolders will be nil if there are no folders if m_tblFolders ~= nil then --enumerate through the found folders for n, m_FoundFolder in pairs(m_tblFolders) do --replace the source's path with the destination's path m_sFolder = String.Replace(m_FoundFolder, sSource, sDestination, false); --create the folder Folder.Create(m_sFolder); error = Application.GetLastError(); if (error ~= 0) then --set n to value to exit FOR loop n = Table.Count(m_tblFolders) end end end --if no errors occurred, copy the files if (error == 0) then --show the status dialog StatusDlg.Show(MB_ICONNONE, false); --copy all files from the source folder, with recurse. File.Copy(sSource .. "\\*.*", sDestination, true, true, false, true, nil); --hide the status dialog StatusDlg.Hide(); error = Application.GetLastError(); end --clean up m_tblFolders = nil; return error; endKopyalama buttonu: sKaynak = Dialog.FolderBrowse("klasor secin", _DesktopFolder) if sKaynak ~= "CANCEL" then sHedef = "C:\\a" if CopyFolder(sKaynak, sHedef) == 0 then result = Dialog.Message("Folder Copy", "The folder has been successfully copied!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); else result = Dialog.Message("Folder Copy", "There was an error copying the folder.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1); end end Quote Link to comment Share on other sites More sharing options...
Skorpion Posted September 19, 2012 Author Share Posted September 19, 2012 @Kintaro benim istegim dosya secmeden belirlemis oldugum Docs klasöründe bulunan bikac klasörü kopyala tusuna tikladigimda belirlenmis yere kopyalamasi bir apz buldum bunda kopyalama yapiyor fakat ayni sizin vermis oldugunuz gibi secmeli bunun kodlarini düzenliyebilirmisiniz acaba secmeli degilde scripte yolu gösterip kopyalaya tikladigimda kopyalamayi gerceklestirsin bu apzda docs klasöründe FldrActn.dll var bu dll kopyalamayi sagliyor sanirim [CODE] select = Dialog.FolderBrowse("Please select a folder:", _SourceDrive); destination = Dialog.FolderBrowse("Please select a folder:", _SourceDrive.."\\destfolder"); result = DLL.CallFunction("AutoPlay\\Docs\\FldrActn.dll", "CopyFolder", "\"" .. select .. "\"" .. ",\"" .. destination .. "\",1,1", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL) Dialog.Message("Notice", result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); [/CODE] [b] [/b] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted September 19, 2012 Share Posted September 19, 2012 benim verdiğimde de, senin verdiğinde de bir değişkeni değiştirip yapabilirsin. benim kodda ki sKaynak = "C:\\abc" sHedef = "D:\\def" şeklinde kaynak ve hedef klasorlerini belirtebilirsin. Senin verdiğin kodda da; select = "C:\\abc" destination = "D:\def" şeklinde kaynak ve hedef klasorlerini belirtebilirsin. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.