Hi,
I am having a requirement where I want to copy files from one folder to another where I should create a destination folder programatically and copy files in it and I want to do it from app.config file and don't want to specify the paths directly. As I was new to coding I don't know how to do it. Please any body tell me how to do this.
Thanks in advance.
I am having a requirement where I want to copy files from one folder to another where I should create a destination folder programatically and copy files in it and I want to do it from app.config file and don't want to specify the paths directly. As I was new to coding I don't know how to do it. Please any body tell me how to do this.
Thanks in advance.
Anbu Azhagan26 pointsPosted May 15, 2014, 4:54 AM EDT
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="SourceFolderPath" value="d:\source" />
<add key="DestFolderPath" value="d:\dest" />
</appSettings>
</configuration>
Step 2: Access the same from C# code
string sourcepath= ConfigurationSettings.AppSettings.Get("SourceFolderPath");
string destinationpath= ConfigurationSettings.AppSettings.Get("DestFolderPath");