• c# 备份数据


      #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 
    
  • 相关阅读:
    程序化量化
    净资产收益率大于10%的选股公式
    转json工具网址https://www.bejson.com/devtools/sql2csharppojo/
    PR 和 MR 的关联
    npm 和 pip 介绍
    QA(测试) 工作准则建议
    2021 年终总结 和 2022 年 flag
    测试排期估时多长合理?
    看完《许三观卖血记》有感
    怎么确定自己的测试准备工作已经做好了?
  • 原文地址:https://www.cnblogs.com/northeastTycoon/p/5703610.html
Copyright © 2020-2023  润新知