protected void CopyFile(string srcfile, string desfile, System.Text.Encoding encoding)
{
StreamReader sr = File.OpenText(srcfile);
StreamWriter sw = new System.IO.StreamWriter(desfile, false, encoding);
try
{
sw.Write(sr.ReadToEnd());
}
catch (IOException ex)
{
console.write(e.message);
}
finally
{
sr.Close();
sw.Close();
}
}
{
StreamReader sr = File.OpenText(srcfile);
StreamWriter sw = new System.IO.StreamWriter(desfile, false, encoding);
try
{
sw.Write(sr.ReadToEnd());
}
catch (IOException ex)
{
console.write(e.message);
}
finally
{
sr.Close();
sw.Close();
}
}