#region 备份数据文件 /// <summary> /// 备份数据文件 /// </summary> /// <param name="strFileName">备份文件目录</param> /// <param name="strTypeKufen">发送还是接收</param> /// <param name="strMessageInfoType">消息类型</param> public void BackUpMessageInfo(String strFileName,String strTypeKufen,String strMessageInfoType) { if (File.Exists(strFileName)) { string strPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BackUpMessageInfo"); string strCombinPath = DateTime.Today.ToString("yyyy-MM-dd").ToString() + "\\" + strTypeKufen.Trim() + "\\" + strMessageInfoType.Trim(); strPath = Path.Combine(strPath, strCombinPath); if (!Directory.Exists(strPath)) { Directory.CreateDirectory(strPath); } #region delele northeasttycoon //if (!Directory.Exists(strPath)) //{ // Directory.CreateDirectory(strPath); //} //strPath = Path.Combine(strPath, DateTime.Today.ToString("yyyy-MM-dd")); //if (!Directory.Exists(strPath)) //{ // Directory.CreateDirectory(strPath); //} //strPath = Path.Combine(strPath, strTypeKufen.Trim()); //if (!Directory.Exists(strPath)) //{ // Directory.CreateDirectory(strPath); //} //strPath = Path.Combine(strPath, strMessageInfoType.Trim()); //if (!Directory.Exists(strPath)) //{ // Directory.CreateDirectory(strPath); //} #endregion delete northeasttycoon string strTempFile = strFileName.Substring(strFileName.LastIndexOf("\\") + 1); strPath = Path.Combine(strPath, strTempFile); File.Copy(strFileName, strPath, true); } } #endregion
时间: 2024-11-05 20:02:39