none
Yerel disk C: RRS feed

Tüm Yanıtlar

  • kullandığın kelimelere dikkat etmek pek önemli değil galiba senin için :)

    e-mail: onay[nokta]yalciner[at]hotmail[nokta]com

    3 Aralık 2019 Salı 12:18
  • Directory.GetDirectories

    Directory.GetFiles

    Directory.CreateDirectory

    File.Copy

    Ornek:

    void Main()
    {
    	CopyFolder(@"c:\KaynakDizin", "c:\HedefDizin");
    }
    
    private void CopyFolder(string sourceDir, string targetDir)
    {
    	CopyFolderWithFiles(sourceDir, targetDir);
    	foreach (var dir in Directory.GetDirectories(sourceDir, "*.*", SearchOption.AllDirectories))
    	{
    		CopyFolderWithFiles(dir,dir.Replace(sourceDir, targetDir));
    	}
    }
    
    private void CopyFolderWithFiles(string sourceDir, string targetDir)
    {
    	if (!Directory.Exists(targetDir))
    	{
    		Directory.CreateDirectory(targetDir);
    	}
    	foreach (var file in Directory.GetFiles(sourceDir, "*.*", SearchOption.TopDirectoryOnly))
    	{
    		File.Copy(file, file.Replace(sourceDir, targetDir));
    	}
    }
    



    How to create a Minimal, Reproducible Example
    The way to Go.
    World's most advanced open source (object-) relational Database.
    Flutter (for mobile, for web & desktop.


    3 Aralık 2019 Salı 12:34
    Yanıtlayıcı