Exemplo n.º 1
0
        public static void Move(string sourceFilePath, string descDirectoryPath)
        {
            string sourceFileName = DirFileHelper.GetFileName(sourceFilePath);

            if (DirFileHelper.IsExistDirectory(descDirectoryPath))
            {
                if (DirFileHelper.IsExistFile(descDirectoryPath + "\\" + sourceFileName))
                {
                    DirFileHelper.DeleteFile(descDirectoryPath + "\\" + sourceFileName);
                }
                File.Move(sourceFilePath, descDirectoryPath + "\\" + sourceFileName);
            }
        }
Exemplo n.º 2
0
 public static void CreateFile(string filePath)
 {
     try
     {
         if (!DirFileHelper.IsExistFile(filePath))
         {
             FileInfo   file = new FileInfo(filePath);
             FileStream fs   = file.Create();
             fs.Close();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }