예제 #1
0
        void CopyAndSaveFile(string source_file_name)
        {
            try
            {
                BusinessLayer.Modules.Authorization oAuthorization = new Authorization();
                Reception oReception = new Reception();

                System.IO.FileInfo fInfo = new System.IO.FileInfo(source_file_name);
                string next_file_name = "";
                int next_file_order = 0;
                oReception.GetNextFileName(ref next_file_name, ref next_file_order);
                string name_file = String.Format("{0}{1}", next_file_name, fInfo.Extension);

                string destiny_file = System.IO.Path.Combine(Path_file_methods, name_file);

                if (!System.IO.Directory.Exists(Path_file_methods))
                    System.IO.Directory.CreateDirectory(Path_file_methods);

                // To copy a file to another location and
                // overwrite the destination file if it already exists.
                System.IO.File.Copy(source_file_name, destiny_file, true);

            }
            catch (Exception ex)
            {
                ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message);
            }
        }