2012-10-28 137 views
2

我想創建一個文件夾並使用c#wpf應用程序將一些圖像複製到它。創建文件夾並將文件複製到本地磁盤

  curName = txt_PoemName.Text; 
      // Specify a "currently active folder" 
      string activeDir = @"C:\Program Files\Default Company Name\Setup2\Poems"; 

      //Create a new subfolder under the current active folder 
      string newPath = System.IO.Path.Combine(activeDir, curName); 

      // Create the subfolder 
      System.IO.Directory.CreateDirectory(newPath); 

       foreach(DictionaryEntry entry in curPoem){ 
        string newFilePath = System.IO.Path.Combine(newPath, entry.Key.ToString() + Path.GetExtension(entry.Value.ToString())); 
        System.IO.File.Copy(entry.Value.ToString(), newFilePath, true); 
       } 

我已經成功地創建的文件夾和圖像。也可以通過應用程序訪問它們。但我不能看到他們在我的本地磁盤上的位置。當我重新啓動機器,然後應用程序也不能看到它們,我可以解決這個問題嗎?

回答

相關問題