• C#底层库--操作文件帮助类FileHelper(获取目录的所有文件)


    系列文章

    C#底层库–程序日志记录类
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/124187709

    C#底层库–MySQLBuilder脚本构建类(select、insert、update、in、带条件的SQL自动生成)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/129179216

    C#底层库–MySQL数据库访问操作辅助类(推荐阅读)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/126886379

    C#底层库–XML配置参数读写辅助类(推荐阅读)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/129175304

    C#底层库–获取文件版本和MD5值
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/112513871

    C#底层库–文件操作类(文件重命名、目录移动、字节流转换)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/126887161

    C#底层库–Excel操作帮助库(可读加密Excel表格)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/126887445

    C#底层库–随机数生成器
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/126888812

    C#底层库–RegexHelper正则表达式辅助类
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/109745286

    C#底层库–CSV和DataTable相互转换
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128804367

    C#底层库–Image图片操作类
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128805298

    C#底层库–JSON使用教程_详细(序列化、反序列化、转DataTable)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128805705

    C#底层库–cookie使用教程
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128816347

    C#底层库–Session操作辅助类
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128817096

    C#底层库–Image图片操作类
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128805298

    C#底层库–数据库类型与程序类型转换器
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/128817610

    C#底层库–StringExtension字符串扩展类
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/129520428

    C#底层库–自定义进制转换器(可去除特殊字符,非Convert.ToString方式)
    本文链接:https://blog.csdn.net/youcheng_ge/article/details/130444724


    前言

    本专栏为【底层库】,主要介绍编程过程中 通用函数。我们将这些通用固化的源码,进行重写、封装、拓展,再进行单元测试、集成测试、beta测试,最终形成通用化模板,这里我们称为“底层库”。

    作为研发人员的你,并不需要花大量时间,研究“底层库”的含义,及“底层库”的实现方法。你只需要几行调用代码,就可以解决项目上碰到的难题。而底层库使用方法,本专栏均有详细介绍,也有项目应用场景。

    底层库已实现功能:MySQL脚本构建器、MySQL数据库访问操作、参数配置文件读写、加解密算法、日志记录、HTTP通信、Socket通信、API前后端交互、邮件发送、文件操作、配置参数存储、Excel导入导出、CSV和DataTable转换、压缩解压、自动编号、Session操作等。

    本专栏会持续更新,不断优化【底层库】,大家有任何问题,可以私信我。本专栏之间关联性较强(我会使用到某些底层库,某些文章可能忽略介绍),如果您对本专栏感兴趣,欢迎关注,我将带你用最简洁的代码,实现最复杂的功能。
    在这里插入图片描述

    一、底层库介绍

    C#底层库–文件操作类(删除目录文件、复制文件到指定目录)

    功能包含:
    1、文件 转换为 字节数组,文件流 转化为 字节数组,
    2、获取指定目录中、指定拓展名,文件的绝对路径
    3、复制目录下文件到指定目录,目录转移,路径合并,删除指定目录文件。
    4、文件重命名,文件移动
    5、以UTF8编码,在指定路径写文件

    二、底层库源码

    创建类FileHelper.cs

    using System;
    using System.IO;
    using System.Text;
    
    namespace Geyc_Utils.FileOperate
    {
        /// 
        /// 文件操作类
        /// 创建人:gyc
        /// 创建时间:2022-03-31
        /// 功能:
        /// 1、文件 转换为 字节数组,文件流 转化为 字节数组,
        /// 2、获取指定目录中、指定拓展名,文件的绝对路径
        /// 3、复制目录下文件到指定目录,目录转移,路径合并,删除指定目录文件。
        /// 4、文件重命名,文件移动
        /// 5、以UTF8编码,在指定路径写文件
        /// 
        /// 说明:使用过程中发现错误,请联系作者修改 https://blog.csdn.net/youcheng_ge
        /// 
        public class FileHelper
        {
    
    
            /// 
            /// 构造函数
            /// 
            public FileHelper() { }
    
    
            /// 
            /// 文件 转换为 字节数组
            /// 
            /// 文件名
            /// 字节数组
            public byte[] GetBinaryFile(string filename)
            {
                if (File.Exists(filename))
                {
                    FileStream Fsm = null;
                    try
                    {
                        Fsm = File.OpenRead(filename);
                        return this.ConvertStreamToByteBuffer(Fsm);
                    }
                    catch (Exception)
                    {
                        return new byte[0];
                    }
                    finally
                    {
                        Fsm.Close();
                    }
                }
                else
                {
                    return new byte[0];
                }
            }
    
    
            /// 
            /// 文件流 转化为 字节数组
            /// 
            /// 文件流
            /// 字节数组
            public byte[] ConvertStreamToByteBuffer(Stream theStream)
            {
                int bi;
                MemoryStream tempStream = new MemoryStream();
                try
                {
                    while ((bi = theStream.ReadByte()) != -1)
                    {
                        tempStream.WriteByte(((byte)bi));
                    }
                    return tempStream.ToArray();
                }
                catch (Exception)
                {
                    return new byte[0];
                }
                finally
                {
                    tempStream.Close();
                }
            }
    
    
            /// 
            /// 路径合并
            /// 
            /// 
            /// 
            /// 
            public string PathCombine(string srcPath, string destPath)
            {
                return Path.Combine(srcPath, destPath);
            }
    
    
            /// 
            /// 获取指定目录中、指定拓展名,文件的绝对路径
            /// 
            /// 目录
            /// 文件名
            /// 拓展名
            /// 
            public string FindFilePath(string a_dirName, string a_fileName, string a_Extension)
            {
                string a_strFileAbsolutelyPath = "";
                DirectoryInfo l_dirInfo = new DirectoryInfo(a_dirName);
                //返回目录中所有文件
                FileInfo[] l_files = l_dirInfo.GetFiles();
                foreach (FileInfo info in l_files)
                {
                    if (info.Name.Contains(a_fileName) && info.Extension == a_Extension)
                    {
                        a_strFileAbsolutelyPath = info.FullName;
                        return a_strFileAbsolutelyPath;
                    }
                }
    
                //返回目录中所有子目录
                DirectoryInfo[] l_childsDir = l_dirInfo.GetDirectories();
                if (l_childsDir.Length >= 0)
                {
                    foreach (DirectoryInfo dirInfo in l_childsDir)
                    {
                        a_strFileAbsolutelyPath = FindFilePath(dirInfo.FullName, a_fileName, a_Extension);
                        return a_strFileAbsolutelyPath;
                    }
                }
                return a_strFileAbsolutelyPath;
            }
    
    
            /// 
            /// 复制目录下文件到指定的目录
            /// 
            /// 源目录
            /// 目标目录
            private void CopyDirectory(string sourceDir, string destDir)
            {
                DirectoryInfo srcDirectory = new DirectoryInfo(sourceDir);
                DirectoryInfo destDirectory = new DirectoryInfo(destDir);
    
                if (destDirectory.FullName.StartsWith(srcDirectory.FullName, StringComparison.CurrentCultureIgnoreCase))
                {
                    throw new Exception("无法将复制文件到子目录,检查文件是否被占用!");
                }
    
                if (!srcDirectory.Exists)
                {
                    throw new Exception("源目录不存在,请检查!");
                }
    
                if (!destDirectory.Exists)
                {
                    destDirectory.Create();
                }
    
                FileInfo[] files = srcDirectory.GetFiles();
    
                for (int i = 0; i < files.Length; i++)
                {
                    CopyFile(files[i].FullName, destDirectory.FullName);
                }
    
                //获取子目录
                DirectoryInfo[] dirs = srcDirectory.GetDirectories();
                for (int j = 0; j < dirs.Length; j++)
                {
                    //使用递归调用,获取子目录中文件
                    CopyDirectory(dirs[j].FullName, Path.Combine(destDirectory.FullName, dirs[j].Name));
                }
            }
    
    
            /// 
            /// 复制文件
            /// 
            /// 源文件名
            /// 目标路径
            public void CopyFile(string sourceFile, string destDir)
            {
                DirectoryInfo destDirectory = new DirectoryInfo(destDir);
                string l_strFileName = Path.GetFileName(sourceFile);
                if (!File.Exists(sourceFile))
                {
                    return;
                }
    
                if (!destDirectory.Exists)
                {
                    destDirectory.Create();
                }
                File.Copy(sourceFile, Path.Combine(destDirectory.FullName, l_strFileName), true);
            }
    
    
            /// 
            /// 文件重命名,文件移动
            /// 
            /// 源文件
            /// 目标文件
            public void RenameFile(string sourceFile, string destFile)
            {
                if (!File.Exists(sourceFile))
                {
                    return;
                }
    
                string l_strDirectoryName = Path.GetDirectoryName(destFile);
                DirectoryInfo destDirectory = new DirectoryInfo(l_strDirectoryName);
    
                if (!destDirectory.Exists)
                {
                    destDirectory.Create();
                }
    
                File.Move(sourceFile, destFile);
            }
    
    
            /// 
            /// 删除指定目录及其所有文件
            /// 
            /// 目录
            public void DeleteDirectory(string a_strPath)
            {
                try
                {
                    //去除文件夹和子文件的只读\隐藏属性
                    DirectoryInfo fileInfo = new DirectoryInfo(a_strPath);
                    fileInfo.Attributes = FileAttributes.Normal & FileAttributes.Directory;
                    //去除文件的只读\隐藏属性
                    File.SetAttributes(a_strPath, FileAttributes.Normal);
    
                    //判断文件夹是否还存在
                    if (Directory.Exists(a_strPath))
                    {
                        foreach (string f in Directory.GetFileSystemEntries(a_strPath))
                        {
                            if (File.Exists(f))
                            {
                                File.Delete(f);
                            }
                            else
                            {
                                DeleteDirectory(f);
                            }
                        }
    
                        //删除空文件夹
                        Directory.Delete(a_strPath);
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
    
    
            /// 
            /// 以UTF8编码,在指定路径写文件
            /// 
            /// 文件内容
            /// 绝对路径
            public void FileWrite(string a_fileText, string a_FileFullPath)
            {
                string dir = Path.GetDirectoryName(a_FileFullPath);
    
                if (!Directory.Exists(dir)) //目录不存在创建目录
                {
                    Directory.CreateDirectory(dir);
                }
    
                using (FileStream fs = new FileStream(a_FileFullPath, FileMode.Create))
                {
                    using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
                    {
                        sw.Write(a_fileText);
                    }
                }
            }
    
    
        }
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291

    三、调用方法

    需要先实例化类,采用点方法调用,代码如下:

    	FileHelper fileHelper = new FileHelper();
    	//删除代码目录
    	fileHelper .DelDirSub(PrintInfoTemp.LocalPath);
    
    • 1
    • 2
    • 3

    四、项目案例

    我做了一个【代码检查工具】,程序员SVN提交的代码,服务器自动下载代码,并检查完代码后。使用本底层库,删除指定目录下,所有SVN下载代码。
    本案例有点复杂,仅供参考,大家可以根据自己项目情况调用。

    		/// 
    		/// 代码信息收集
    		/// 
    		/// 
    		/// 
    		/// 
    		/// 
    		/// 
    		/// 
    		/// 
    		public static void CodeInfoCollection(AssemblyInfo a_AssemblyInfo,string a_strZJConnnection,
    		                                      string a_param1,string a_param2,string a_param3,
    		                                      out bool a_bSuccess,out string a_strMsgError)
    		{
    			MakeSQLHelper m_MakeSQLHelper = new MakeSQLHelper();
    			a_bSuccess = true;
    			a_strMsgError = "";
    			
    			if(a_AssemblyInfo.SourceCodePath==""
    			   ||a_AssemblyInfo.CVSPath==""
    			   ||a_AssemblyInfo.CVSRootPath=="")
    			{
    				a_bSuccess = false;
    				a_strMsgError = "CVS代码路径为空!";
    				return;
    			}
    			
    			if(a_AssemblyInfo.WorkDir == "")
    			{
    				a_bSuccess = false;
    				a_strMsgError = "CVS工作目录为空!";
    				return;
    			}
    			
    			if(a_AssemblyInfo.CVSExePath=="")
    			{
    				a_bSuccess = false;
    				a_strMsgError = "CVS安装程序为空!";
    				return;
    			}
    			
    			PrintInfo PrintInfoTemp = new PrintInfo();
    			PrintInfoTemp.SystemNo = a_AssemblyInfo.SystemNo;
    			PrintInfoTemp.AssemblyNo = a_AssemblyInfo.AssemblyNo;
    			PrintInfoTemp.CVSPath = a_AssemblyInfo.CVSPath;
    			PrintInfoTemp.CVSRootPath = a_AssemblyInfo.CVSRootPath;
    			PrintInfoTemp.SourceCodePath = a_AssemblyInfo.SourceCodePath;
    			PrintInfoTemp.CVSExePath = a_AssemblyInfo.CVSExePath;
    			PrintInfoTemp.CVSUser = a_AssemblyInfo.CVSUser;
    			PrintInfoTemp.CVSPsw = a_AssemblyInfo.CVSPsw;
    			PrintInfoTemp.WorkDir = a_AssemblyInfo.WorkDir;
    			PrintInfoTemp.CVSCmdPath = PrintInfoTemp.SourceCodePath.Replace(@"I:\CVSCode\W4\", "");
    			PrintInfoTemp.CVSCmd = string.Format(Const.ct_strCVSCMD, PrintInfoTemp.CVSUser, PrintInfoTemp.CVSPsw, PrintInfoTemp.CVSCmdPath);
    			
    			#region CVS代码下载
    			CVSHelper m_CVSHelper = new CVSHelper();
    			//1、CVS代码授权
    			if(a_bSuccess)
    			{
    				string l_strCVSMsg = "";
    				if(m_CVSHelper.CVSSaveTakeData(PrintInfoTemp.CVSRootPath,PrintInfoTemp.CVSPath,PrintInfoTemp.CVSUser,
    				                               PrintInfoTemp.AssemblyNo,out l_strCVSMsg))
    				{
    					a_bSuccess = true;
    					a_strMsgError = l_strCVSMsg;
    				}
    				else
    				{
    					a_bSuccess = false;
    					a_strMsgError = l_strCVSMsg;
    				}
    			}
    			
    			//2、代码下载
    			if(a_bSuccess)
    			{
    				string l_strCVSMsg = "";
    				string l_strTempPath = PrintInfoTemp.SourceCodePath.Replace(@"I:\CVSCode\W4\", "");
    				string l_strCmd = string.Format(Const.ct_strCVSCMD, PrintInfoTemp.CVSUser, PrintInfoTemp.CVSPsw, l_strTempPath);
    				PrintInfoTemp.LocalPath = Path.Combine(PrintInfoTemp.WorkDir, l_strTempPath);
    				if(m_CVSHelper.CVSCodeDown(PrintInfoTemp.CVSExePath,l_strCmd,PrintInfoTemp.WorkDir,out l_strCVSMsg) )
    				{
    					//检查是否更新成功
    					if(!Directory.Exists(PrintInfoTemp.LocalPath))
    					{
    						a_bSuccess = false;
    						a_strMsgError = "CVS代码下载为空!";
    					}
    				}
    				else
    				{
    					m_CVSHelper.p_ErrorDataReceived(null,null);
    					FileHelper.DelDirSub(PrintInfoTemp.LocalPath);
    					a_bSuccess = false;
    					a_strMsgError = "CVS代码下载异常,"+l_strCVSMsg;
    				}
    			}
    			#endregion
    			
    			#region 2、加载文件MainController
    			string[] l_ArrayCodeContent = null;
    			string l_strCodeContent = "";//代码内容
    			string l_strFileAbsolutelyPath = "";
    			if(a_bSuccess)
    			{
    				l_strFileAbsolutelyPath = FileHelper.FindFilePath(PrintInfoTemp.LocalPath,"MainController",".cs");
    				if(File.Exists( l_strFileAbsolutelyPath))
    				{
    					l_ArrayCodeContent = File.ReadAllLines(l_strFileAbsolutelyPath);
    					l_strCodeContent = File.ReadAllText(l_strFileAbsolutelyPath);
    				}
    				else
    				{
    					a_bSuccess = false;
    					a_strMsgError = "MainController.cs文件不存在!";
    				}
    			}
    			#endregion
    			
    			#region 数据集定义
    			List<T_client_assembly_dataset_define> list_assembly_dataset = new List<T_client_assembly_dataset_define>();
    			List<T_client_assembly_dataset_field> list_assembly_dataset_field = new List<T_client_assembly_dataset_field>();
    			list_assembly_dataset.Clear();
    			list_assembly_dataset_field.Clear();
    			
    			if(a_bSuccess)
    			{
    				Dictionary<string,string> dic_cdsEntity = new Dictionary<string,string>();
    				
    				Regex reg_Entity = new Regex(@"(cds\S*Entity)(?!\(\))",RegexOptions.IgnoreCase);
    				MatchCollection matches = reg_Entity.Matches(l_strCodeContent );
    				foreach(Match item in matches)
    				{
    					if(dic_cdsEntity.ContainsKey(item.Value)==false)
    					{
    						dic_cdsEntity.Add(item.Value,item.Value);
    					}
    				}
    				
    				foreach(var item in dic_cdsEntity)
    				{
    					T_client_assembly_dataset_define assembly_dataset = new T_client_assembly_dataset_define();
    					assembly_dataset.system_no = PrintInfoTemp.SystemNo;
    					assembly_dataset.assembly_no = PrintInfoTemp.AssemblyNo;
    					assembly_dataset.dataset_define = item.Value;
    					list_assembly_dataset.Add(assembly_dataset);
    				}
    				
    				foreach(var itemEntity in dic_cdsEntity)
    				{
    					string l_strCdsFileName = itemEntity.Value.Replace("Entity","");
    					l_strFileAbsolutelyPath = FileHelper.FindFilePath(PrintInfoTemp.LocalPath,l_strCdsFileName,".dsxml");
    					
    					if(File.Exists(l_strFileAbsolutelyPath) && l_strFileAbsolutelyPath!="")
    					{
    						List<DataSetField>list_DataSetField = new List<DataSetField>();
    						list_DataSetField = PrintDataLib.GetDataSetByPath(l_strFileAbsolutelyPath);
    						if(list_DataSetField!=null && list_DataSetField.Count>0)
    						{
    							foreach(DataSetField Field in list_DataSetField)
    							{
    								T_client_assembly_dataset_field l_dataset_field = new T_client_assembly_dataset_field();
    								l_dataset_field.system_no = PrintInfoTemp.SystemNo;
    								l_dataset_field.assembly_no = PrintInfoTemp.AssemblyNo;
    								l_dataset_field.dataset_define = itemEntity.Value;
    								l_dataset_field.field_name = Field.field_name;
    								l_dataset_field.db_name = Field.db_name;
    								l_dataset_field.table_name = Field.table_name;
    								l_dataset_field.field_type = Field.field_type;
    								l_dataset_field.col_name = Field.col_name;
    								l_dataset_field.data_type = Field.data_type;
    								l_dataset_field.caption = Field.caption;
    								l_dataset_field.col_len = Field.col_len;
    								l_dataset_field.field_note = Field.field_note;
    								l_dataset_field.is_pk = Field.is_pk;
    								list_assembly_dataset_field.Add(l_dataset_field);
    							}
    						}
    					}
    					else
    					{
    						a_bSuccess = false;
    						a_strMsgError = "未找到数据集文件"+l_strCdsFileName+".dsxml";
    						break;
    					}
    				}
    			}
    			
    			
    			if(a_bSuccess)
    			{
    				try
    				{
    					string l_strSqlAll = "";
    					string l_strSqlDel = string.Format(Const.ct_strDelAssemblyDatasetDefine,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    					string l_strInsert = "";
    					if(list_assembly_dataset!=null && list_assembly_dataset.Count>0)
    					{
    						l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_dataset_define",list_assembly_dataset);
    					}
    					l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    					DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    				}
    				catch(Exception ex)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "保存数据集定义异常:"+ex.Message;
    				}
    			}
    			
    			if(a_bSuccess)
    			{
    				try
    				{
    					string l_strSqlAll = "";
    					string l_strSqlDel = string.Format(Const.ct_strDelAssemblyDatasetfield,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    					string l_strInsert = "";
    					if(list_assembly_dataset_field!=null && list_assembly_dataset_field.Count>0)
    					{
    						l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_dataset_field",list_assembly_dataset_field);
    					}
    					l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    					DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    				}
    				catch(Exception ex)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "保存数据集字段异常:"+ex.Message;
    				}
    			}
    			#endregion
    			
    			if(a_bSuccess)
    			{
    				//大循环,遍历整个代码行,把所有的 PrintCall.Print 都找到
    				for(int OutCodeNum = 0; OutCodeNum<l_ArrayCodeContent.Length;OutCodeNum++ )
    				{
    					string l_strPrintCall = "";
    					bool l_bMatch = false;
    					
    					//循环,找到一个  PrintCall.Print  把 代码 复制到 l_strPrintCall
    					for(int IncodeNum=OutCodeNum;IncodeNum<l_ArrayCodeContent.Length;IncodeNum++)
    					{
    						string l_oneline = PrintDataLib.RemoveSpace(l_ArrayCodeContent[IncodeNum]);
    						if(l_oneline.Contains("//")) continue;
    						
    						//3.1 匹配PrintCall语句
    						Regex reg = new Regex(@"PrintCall.Print\((.*?)",RegexOptions.IgnoreCase);
    						Match match = reg.Match(l_oneline);
    						if(match.Success)//匹配到
    						{
    							l_bMatch = true;
    						}
    						
    						if(l_bMatch)//匹配到
    						{
    							if(l_strPrintCall.Contains(";"))
    							{
    								PrintInfoTemp.PrintCallRowNum = IncodeNum;//行数
    								PrintInfoTemp.PrintCall = l_strPrintCall;//PrintCall行
    								OutCodeNum = IncodeNum + 1;  //这个代表 大循环应该从 找到的下一行继续找下一个  PrintCall行
    								
    								//3.2 获取打印方法,反向逆读取代码行
    								bool l_bFindMethodIsSucee = false;
    								for(int j=PrintInfoTemp.PrintCallRowNum;j>0;j--)
    								{
    									string l_strLastRead = PrintDataLib.RemoveSpace(l_ArrayCodeContent[j]);//行号
    									
    									if(l_strLastRead.Contains("publicvoid"))
    									{
    										l_bFindMethodIsSucee = true;
    										PrintInfoTemp.Method = PrintDataLib.SubstringSingle(l_strLastRead,"publicvoid","(");
    										break;
    									}
    									else if(l_strLastRead.Contains("publicbool"))
    									{
    										l_bFindMethodIsSucee = true;
    										PrintInfoTemp.Method = PrintDataLib.SubstringSingle(l_strLastRead,"publicbool","(");
    										break;
    									}
    								}
    								
    								if(!l_bFindMethodIsSucee)
    								{
    									a_bSuccess = false;
    									a_strMsgError = "未找到printcall语句!";
    									continue;
    								}
    								
    								//3.3 获取打印类型
    								List<T_client_assembly_print_dataset> m_listprint_dataset = new List<T_client_assembly_print_dataset>();
    								List<T_client_assembly_print_dataset_field> m_listprint_dataset_field = new List<T_client_assembly_print_dataset_field>();
    								
    								m_listprint_dataset.Clear();
    								m_listprint_dataset_field.Clear();
    								
    								string l_strPrint = PrintDataLib.SubstringSingle(PrintInfoTemp.PrintCall,"PrintCall.Print(",");");
    								string l_BillTypeVar = "";//打印类型变量
    								string[] l_CdsMasterVar;//数据集
    								string[] l_DataTableVar;//表
    								try
    								{
    									PrintDataLib.SplitPrintParm(l_strPrint,out l_BillTypeVar,out l_CdsMasterVar,out l_DataTableVar);
    								}
    								catch(Exception)
    								{
    									a_bSuccess = false;
    									a_strMsgError = "printcall语句语法解析失败:"+PrintInfoTemp.PrintCall;
    									continue;
    								}
    								
    								PrintInfoTemp.BillTypePar = PrintDataLib.GetFunParbyName(l_ArrayCodeContent,l_BillTypeVar);
    								PrintInfoTemp.CdsMasterVar = l_CdsMasterVar;//数据集
    								PrintInfoTemp.DataTableVar = l_DataTableVar;//数据表
    								
    								//3.4 数据集
    								m_listprint_dataset.Clear();
    								for(int l_intDatasetSN = 0;l_intDatasetSN<PrintInfoTemp.CdsMasterVar.Length;l_intDatasetSN++)
    								{
    									T_client_assembly_print_dataset l_print_dataset = new T_client_assembly_print_dataset();
    									l_print_dataset.system_no = PrintInfoTemp.SystemNo;
    									l_print_dataset.assembly_no = PrintInfoTemp.AssemblyNo;
    									l_print_dataset.print_method = PrintInfoTemp.Method;
    									l_print_dataset.order_sn = l_intDatasetSN+1;
    									l_print_dataset.dataset_fun_par = PrintDataLib.GetFunParbyName(l_ArrayCodeContent,PrintInfoTemp.CdsMasterVar[l_intDatasetSN]);
    									l_print_dataset.dataset_name = PrintInfoTemp.CdsMasterVar[l_intDatasetSN];
    									m_listprint_dataset.Add(l_print_dataset);
    								}
    								
    								//3.5 数据集字段
    								bool l_bIsFindXml = false;//是否匹配到
    								m_listprint_dataset_field.Clear();
    								List<DataSetField> list_DataSetField;
    								for(int l_intDatasetSN = 0;l_intDatasetSN<PrintInfoTemp.DataTableVar.Length;l_intDatasetSN++)
    								{
    									string l_strCdsFileName = PrintDataLib.GetdsxmlFileNameByDataTable(l_ArrayCodeContent,PrintInfoTemp.DataTableVar[l_intDatasetSN]);
    									
    									l_strFileAbsolutelyPath = FileHelper.FindFilePath(PrintInfoTemp.LocalPath,l_strCdsFileName,".dsxml");
    									
    									if(File.Exists(l_strFileAbsolutelyPath) && l_strFileAbsolutelyPath!="")
    									{
    										l_bIsFindXml = true;
    										list_DataSetField = new List<DataSetField>();
    										list_DataSetField = PrintDataLib.GetDataSetByPath(l_strFileAbsolutelyPath);
    										if(list_DataSetField!=null && list_DataSetField.Count>0)
    										{
    											foreach(DataSetField Field in list_DataSetField)
    											{
    												T_client_assembly_print_dataset_field l_print_dataset_field = new T_client_assembly_print_dataset_field();
    												l_print_dataset_field.system_no = PrintInfoTemp.SystemNo;
    												l_print_dataset_field.assembly_no = PrintInfoTemp.AssemblyNo;
    												l_print_dataset_field.print_method = PrintInfoTemp.Method;
    												l_print_dataset_field.order_sn = l_intDatasetSN+1;
    												l_print_dataset_field.field_name = Field.field_name;
    												l_print_dataset_field.db_name = Field.db_name;
    												l_print_dataset_field.table_name = Field.table_name;
    												l_print_dataset_field.field_type = Field.field_type;
    												l_print_dataset_field.col_name = Field.col_name;
    												l_print_dataset_field.data_type = Field.data_type;
    												l_print_dataset_field.caption = Field.caption;
    												l_print_dataset_field.col_len = Field.col_len;
    												l_print_dataset_field.field_note = Field.field_note;
    												l_print_dataset_field.is_pk = Field.is_pk;
    												m_listprint_dataset_field.Add(l_print_dataset_field);
    											}
    										}
    									}
    									else
    									{
    										a_bSuccess = false;
    										a_strMsgError = "未找到数据集文件"+l_strCdsFileName+".dsxml";
    										break;
    									}
    								}
    								
    								//未找到XML文件,终止执行
    								if(!l_bIsFindXml)
    								{
    									break;
    								}
    								
    								//打印方法构造
    								T_client_assembly_print_method l_print_method = new T_client_assembly_print_method();
    								List<T_client_assembly_print_method> m_listprint_method = new List<T_client_assembly_print_method>();
    								m_listprint_method.Clear();
    								l_print_method = new T_client_assembly_print_method();
    								l_print_method.assembly_no = PrintInfoTemp.AssemblyNo;
    								l_print_method.system_no = PrintInfoTemp.SystemNo;
    								l_print_method.print_method = PrintInfoTemp.Method;
    								l_print_method.print_type_fun_par = PrintInfoTemp.BillTypePar;
    								m_listprint_method.Add(l_print_method);
    								
    								string l_strSqlAll = "";
    								string l_strSqlDel = "";
    								string l_strInsert = "";
    								
    								if(m_listprint_method.Count>0)
    								{
    									try
    									{
    										l_strSqlAll = "";
    										l_strSqlDel = string.Format(Const.ct_strDelmethod,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo,PrintInfoTemp.Method);
    										l_strInsert = "";
    										l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_print_method",m_listprint_method);
    										l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    										DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    									}
    									catch(Exception ex)
    									{
    										l_strPrintCall = "";
    										l_bMatch = false;//是否匹配到
    										a_bSuccess = false;
    										a_strMsgError = "插入打印方法表异常:"+ex.Message;
    										return;
    									}
    								}
    								
    								//T_client_assembly_print_dataset
    								if(m_listprint_dataset.Count>0)
    								{
    									try
    									{
    										l_strSqlAll = "";
    										l_strSqlDel = string.Format(Const.ct_strDeldataset,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo,PrintInfoTemp.Method);
    										l_strInsert = m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_print_dataset",m_listprint_dataset);
    										l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    										DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    									}
    									catch(Exception ex)
    									{
    										l_strPrintCall = "";
    										l_bMatch = false;
    										a_bSuccess = false;
    										a_strMsgError = "插入打印数据集异常:"+ex.Message;
    										return;
    									}
    								}
    								
    								//T_client_assembly_print_dataset_field
    								if(m_listprint_dataset_field.Count>0)
    								{
    									try
    									{
    										l_strSqlAll = "";
    										l_strSqlDel = string.Format(Const.ct_strDeldataset_field,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo,PrintInfoTemp.Method);
    										l_strInsert = m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_print_dataset_field",m_listprint_dataset_field);
    										l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    										DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    									}
    									catch(Exception ex)
    									{
    										l_strPrintCall = "";
    										l_bMatch = false;//是否匹配到
    										a_bSuccess = false;
    										a_strMsgError = "插入打印数据集字段异常:"+ex.Message;
    										return;
    									}
    								}
    								
    								break;
    							}
    							else
    							{
    								l_strPrintCall += l_oneline;
    							}
    						}
    						
    					}
    					//结束大循环
    					if(!l_bMatch)
    					{
    						break;
    					}
    				}
    			}
    			
    			
    			#region Cost常量
    			List<T_client_assembly_constant> list_assembly_constant = new List<T_client_assembly_constant>();
    			list_assembly_constant.Clear();
    			CompilerResults cr  = null;
    			
    			if(a_bSuccess)
    			{
    				string l_strConstFilePath = FileHelper.FindFilePath(PrintInfoTemp.LocalPath,"Const",".cs");
    				if(!File.Exists( l_strConstFilePath) || l_strConstFilePath=="")
    				{
    					return;
    				}
    
    				// 1.CSharpCodePrivoder
    				CSharpCodeProvider objCSharpCodePrivoder = new CSharpCodeProvider();
    
    				// 2.ICodeComplier
    				ICodeCompiler objICodeCompiler = objCSharpCodePrivoder.CreateCompiler();
    				// 3.CompilerParameters
    				CompilerParameters objCompilerParameters = new CompilerParameters();
    				objCompilerParameters.ReferencedAssemblies.Add("System.dll");
    				objCompilerParameters.GenerateExecutable = false;
    				objCompilerParameters.GenerateInMemory = true;
    
    				// 4.CompilerResults
    				string l_strText = File.ReadAllText(l_strConstFilePath);
    				cr = objICodeCompiler.CompileAssemblyFromSource(objCompilerParameters,l_strText);
    				
    				if(cr.Errors.HasErrors)
    				{
    					string l_strZJName = "";
    					foreach (CompilerError err in cr.Errors)
    					{
    						l_strZJName += err.ErrorText+"、";
    					}
    					a_bSuccess = false;
    					a_strMsgError = "Const单元动态加载失败,引用未知组件"+l_strZJName;
    				}
    			}
    			
    			//反射
    			if(a_bSuccess)
    			{
    				string l_strNameSpace = "";
    				Regex reg_namespace = new Regex(@"(?<=namespace).*",RegexOptions.IgnoreCase);
    				MatchCollection matches_namespace = reg_namespace.Matches(l_strCodeContent );
    				foreach(Match item in matches_namespace)
    				{
    					l_strNameSpace = PrintDataLib.RemoveSpace(item.Value);
    				}
    				
    				if(l_strNameSpace=="")
    				{
    					a_bSuccess = false;
    					a_strMsgError = "获取命名空间名失败";
    					return;
    				}
    				
    				//5、CompiledAssembly
    				try
    				{
    					Assembly objAssembly = cr.CompiledAssembly;
    					Type t = objAssembly.GetType( l_strNameSpace+".Const");
    					FieldInfo[] fis=t.GetFields();  // 注意,这里不能有任何选项,否则将无法获取到const常量
    					
    					foreach (var fieldInfo in fis)
    					{
    						T_client_assembly_constant assembly_constant = new T_client_assembly_constant();
    						assembly_constant.constant_guid = Guid.NewGuid().ToString();
    						assembly_constant.system_no = PrintInfoTemp.SystemNo;
    						assembly_constant.assembly_no = PrintInfoTemp.AssemblyNo;
    						assembly_constant.const_name = fieldInfo.Name;
    						assembly_constant.const_value = fieldInfo.GetRawConstantValue().ToString();
    						list_assembly_constant.Add(assembly_constant);
    					}
    				}
    				catch(Exception)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "Const单元代码反射解析失败,不能转换为Type类型!";
    				}
    			}
    			
    			
    			if(a_bSuccess)
    			{
    				try
    				{
    					string l_strSqlAll = "";
    					string l_strSqlDel = string.Format(Const.ct_strDelConstant,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    					string l_strInsert = "";
    					if(list_assembly_constant!=null && list_assembly_constant.Count>0)
    					{
    						l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_constant",list_assembly_constant);
    					}
    					l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    					DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    				}
    				catch(Exception ex)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "保存常量数据异常:"+ex.Message;
    				}
    			}
    			#endregion
    			
    			#region 词汇引用(word_table、simple_code)
    			List<T_client_assembly_word> l_list_assembly_word = new List<T_client_assembly_word>();
    			l_list_assembly_word.Clear();
    			
    			if(a_bSuccess)
    			{
    				m_listReadFile.Clear();
    				FindFiles(PrintInfoTemp.LocalPath,".cs");
    				
    				if(m_listReadFile==null && m_listReadFile.Count==0)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "项目中不存在*.cs文件,无法解析词汇引用!";
    				}
    			}
    
    			
    			if(a_bSuccess)
    			{
    				foreach(string l_strFile in m_listReadFile)//文件列表
    				{
    					string l_strFileName = System.IO.Path.GetFileName(l_strFile);
    					string l_strWord = "";
    					string l_strType = "";
    					
    					l_strCodeContent = "";
    					
    					if(File.Exists( l_strFile))
    					{
    						l_strCodeContent = File.ReadAllText(l_strFile);
    						Dictionary<string,string> dic_Word = new Dictionary<string,string>();
    						
    						Regex reg_Entity = new Regex(@"(?<=Register\()([^;]*)(?=\))",RegexOptions.IgnoreCase);
    						MatchCollection matches = reg_Entity.Matches(l_strCodeContent );
    						
    						foreach(Match item in matches)
    						{
    							if(dic_Word.ContainsKey(item.Value)==false)
    							{
    								dic_Word.Add(item.Value,item.Value);
    							}
    						}
    						
    						foreach(var item in dic_Word)
    						{
    							PrintDataLib.GetWordKind(item.Key,out l_strWord,out l_strType);
    							T_client_assembly_word assembly_word = new T_client_assembly_word();
    							assembly_word.word_guid = Guid.NewGuid().ToString();
    							assembly_word.system_no = PrintInfoTemp.SystemNo;
    							assembly_word.assembly_no = PrintInfoTemp.AssemblyNo;
    							assembly_word.words_kind = l_strWord;
    							assembly_word.words_type = l_strType;
    							l_list_assembly_word.Add(assembly_word);
    						}
    					}
    					else
    					{
    						a_bSuccess = false;
    						a_strMsgError = "文件路径不存在:"+l_strFile;
    						break;
    					}
    				}
    			}
    			
    			if(a_bSuccess)
    			{
    				try
    				{
    					string l_strSqlAll = "";
    					string l_strSqlDel = string.Format(Const.ct_strDelWord,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    					string l_strInsert = "";
    					if(l_list_assembly_word!=null && l_list_assembly_word.Count>0)
    					{
    						l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_word",l_list_assembly_word);
    					}
    					l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    					DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    				}
    				catch(Exception ex)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "保存词汇引用数据异常:"+ex.Message;
    				}
    			}
    			#endregion
    			
    			#region 表格控件对象
    			List<T_client_assembly_grid_controls_views> list_controls_views = new List<T_client_assembly_grid_controls_views>();
    			List<T_client_assembly_grid_controls_columns> list_controls_columns = new List<T_client_assembly_grid_controls_columns>();
    			list_controls_views.Clear();
    			list_controls_columns.Clear();
    			
    			if(a_bSuccess)
    			{
    				string l_strSqlDel = string.Format(Const.ct_strDelControlsViews,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    				DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlDel);
    				l_strSqlDel = string.Format(Const.ct_strDelControlsColumns,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    				DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlDel);
    				
    				foreach(string l_strFile in m_listReadFile)
    				{
    					string l_strFileName = System.IO.Path.GetFileName(l_strFile);
    					
    					if(l_strFile.Contains("DataSet") )//排除数据集
    					{
    						continue;
    					}
    					
    					if(!l_strFileName.Contains("Designer")  )
    					{
    						continue;
    					}
    					
    					if(File.Exists(l_strFile))
    					{
    						list_controls_views.Clear();
    						list_controls_columns.Clear();
    						
    						GridControlsOpera l_GridControls = new GridControlsOpera();
    						l_GridControls.AnalysisDBGrid(l_strFile,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo,
    						                              out list_controls_views,out list_controls_columns);
    						try
    						{
    							string l_strInsert = "";
    							if(list_controls_views!=null && list_controls_views.Count>0)
    							{
    								l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_grid_controls_views",list_controls_views);
    								DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strInsert);
    							}
    						}
    						catch(Exception ex)
    						{
    							a_bSuccess = false;
    							a_strMsgError = "保存表控件异常:"+ex.Message;
    						}
    						
    						try
    						{
    							string l_strInsert = "";
    							if(list_controls_columns!=null && list_controls_columns.Count>0)
    							{
    								l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_grid_controls_columns",list_controls_columns);
    								DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strInsert);
    							}
    						}
    						catch(Exception ex)
    						{
    							a_bSuccess = false;
    							a_strMsgError = "保存表格列控件异常:"+ex.Message;
    						}
    					}
    				}
    			}
    			#endregion
    			
    			#region 数据权限
    			List<T_client_assembly_data_power> l_list_data_power = new List<T_client_assembly_data_power>();
    			l_list_data_power.Clear();
    			if(a_bSuccess)
    			{
    				foreach(string l_strFile in m_listReadFile)//文件列表
    				{
    					string l_strFileName = System.IO.Path.GetFileName(l_strFile);
    					string l_strFun = "";
    					string l_strParam = "";
    					
    					if(l_strFileName.Contains("Designer") )
    					{
    						continue;
    					}
    					
    					l_strCodeContent = "";
    					
    					if(File.Exists( l_strFile))
    					{
    						DataPowerOpera l_DataPower = new DataPowerOpera();
    						
    						Dictionary<string,string> dic_Power = new Dictionary<string,string>();
    						dic_Power = l_DataPower.GetBizHandler(l_strFile);
    						
    						foreach(var item in dic_Power)
    						{
    							l_DataPower.GetDataPower(item.Key,out l_strFun,out l_strParam);
    							T_client_assembly_data_power data_power = new T_client_assembly_data_power();
    							data_power.power_guid = Guid.NewGuid().ToString();
    							data_power.system_no = PrintInfoTemp.SystemNo;
    							data_power.assembly_no = PrintInfoTemp.AssemblyNo;
    							data_power.power_fun_name = l_strFun;
    							data_power.param_text = l_strParam;
    							l_list_data_power.Add(data_power);
    						}
    					}
    					else
    					{
    						a_bSuccess = false;
    						a_strMsgError = "文件路径不存在:"+l_strFile;
    						break;
    					}
    				}
    			}
    			
    			if(a_bSuccess)
    			{
    				try
    				{
    					string l_strSqlAll = "";
    					string l_strSqlDel = string.Format(Const.ct_strDelPower,PrintInfoTemp.SystemNo,PrintInfoTemp.AssemblyNo);
    					string l_strInsert = "";
    					if(l_list_data_power!=null && l_list_data_power.Count>0)
    					{
    						l_strInsert=m_MakeSQLHelper.CreateInsertSQLBuilder("T_client_assembly_data_power",l_list_data_power);
    					}
    					l_strSqlAll = l_strSqlDel+"\r\n"+l_strInsert+"\r\n";
    					DBOperate.DBInsertAndUpdate(a_strZJConnnection,l_strSqlAll);
    				}
    				catch(Exception ex)
    				{
    					a_bSuccess = false;
    					a_strMsgError = "保存数据权限异常:"+ex.Message;
    				}
    			}
    			#endregion
    			
    			
    			//删除代码目录
    			FileHelper.DelDirSub(PrintInfoTemp.LocalPath);
    		}
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404
    • 405
    • 406
    • 407
    • 408
    • 409
    • 410
    • 411
    • 412
    • 413
    • 414
    • 415
    • 416
    • 417
    • 418
    • 419
    • 420
    • 421
    • 422
    • 423
    • 424
    • 425
    • 426
    • 427
    • 428
    • 429
    • 430
    • 431
    • 432
    • 433
    • 434
    • 435
    • 436
    • 437
    • 438
    • 439
    • 440
    • 441
    • 442
    • 443
    • 444
    • 445
    • 446
    • 447
    • 448
    • 449
    • 450
    • 451
    • 452
    • 453
    • 454
    • 455
    • 456
    • 457
    • 458
    • 459
    • 460
    • 461
    • 462
    • 463
    • 464
    • 465
    • 466
    • 467
    • 468
    • 469
    • 470
    • 471
    • 472
    • 473
    • 474
    • 475
    • 476
    • 477
    • 478
    • 479
    • 480
    • 481
    • 482
    • 483
    • 484
    • 485
    • 486
    • 487
    • 488
    • 489
    • 490
    • 491
    • 492
    • 493
    • 494
    • 495
    • 496
    • 497
    • 498
    • 499
    • 500
    • 501
    • 502
    • 503
    • 504
    • 505
    • 506
    • 507
    • 508
    • 509
    • 510
    • 511
    • 512
    • 513
    • 514
    • 515
    • 516
    • 517
    • 518
    • 519
    • 520
    • 521
    • 522
    • 523
    • 524
    • 525
    • 526
    • 527
    • 528
    • 529
    • 530
    • 531
    • 532
    • 533
    • 534
    • 535
    • 536
    • 537
    • 538
    • 539
    • 540
    • 541
    • 542
    • 543
    • 544
    • 545
    • 546
    • 547
    • 548
    • 549
    • 550
    • 551
    • 552
    • 553
    • 554
    • 555
    • 556
    • 557
    • 558
    • 559
    • 560
    • 561
    • 562
    • 563
    • 564
    • 565
    • 566
    • 567
    • 568
    • 569
    • 570
    • 571
    • 572
    • 573
    • 574
    • 575
    • 576
    • 577
    • 578
    • 579
    • 580
    • 581
    • 582
    • 583
    • 584
    • 585
    • 586
    • 587
    • 588
    • 589
    • 590
    • 591
    • 592
    • 593
    • 594
    • 595
    • 596
    • 597
    • 598
    • 599
    • 600
    • 601
    • 602
    • 603
    • 604
    • 605
    • 606
    • 607
    • 608
    • 609
    • 610
    • 611
    • 612
    • 613
    • 614
    • 615
    • 616
    • 617
    • 618
    • 619
    • 620
    • 621
    • 622
    • 623
    • 624
    • 625
    • 626
    • 627
    • 628
    • 629
    • 630
    • 631
    • 632
    • 633
    • 634
    • 635
    • 636
    • 637
    • 638
    • 639
    • 640
    • 641
    • 642
    • 643
    • 644
    • 645
    • 646
    • 647
    • 648
    • 649
    • 650
    • 651
    • 652
    • 653
    • 654
    • 655
    • 656
    • 657
    • 658
    • 659
    • 660
    • 661
    • 662
    • 663
    • 664
    • 665
    • 666
    • 667
    • 668
    • 669
    • 670
    • 671
    • 672
    • 673
    • 674
    • 675
    • 676
    • 677
    • 678
    • 679
    • 680
    • 681
    • 682
    • 683
    • 684
    • 685
    • 686
    • 687
    • 688
    • 689
    • 690
    • 691
    • 692
    • 693
    • 694
    • 695
    • 696
    • 697
    • 698
    • 699
    • 700
    • 701
    • 702
    • 703
    • 704
    • 705
    • 706
    • 707
    • 708
    • 709
    • 710
    • 711
    • 712
    • 713
    • 714
    • 715
    • 716
    • 717
    • 718
    • 719
    • 720
    • 721
    • 722
    • 723
    • 724
    • 725
    • 726
    • 727
    • 728
    • 729
    • 730
    • 731
    • 732
    • 733
    • 734
    • 735
    • 736
    • 737
    • 738
    • 739
    • 740
    • 741
    • 742
    • 743
    • 744
    • 745
    • 746
    • 747
    • 748
    • 749
    • 750
    • 751
    • 752
    • 753
    • 754
    • 755
    • 756
    • 757
    • 758
    • 759
    • 760
    • 761
    • 762
    • 763
    • 764
    • 765
    • 766
    • 767
    • 768
    • 769
    • 770
    • 771
    • 772
    • 773
    • 774
    • 775
    • 776
    • 777
    • 778
    • 779
    • 780
    • 781
    • 782
    • 783
    • 784
    • 785
    • 786
    • 787
    • 788
    • 789
    • 790
    • 791
    • 792
    • 793
    • 794
    • 795
    • 796
    • 797
    • 798
    • 799
    • 800
    • 801
    • 802
    • 803
    • 804
    • 805
    • 806
    • 807
    • 808
    • 809
    • 810
  • 相关阅读:
    这道 Mysql 的解题思想,值得学习!
    UNI-Admin基础框架怎么关闭创建超级管理员入口?
    JSD-2204-JavaScript-Vue-Day05
    弘辽科技:100块的直通车,怎么开?电商运营新手篇
    当多条折线数据渲染在一个echarts里,这些折线的x轴数据是不统一的,处理方法
    Offer 经验分享 - 蚂蚁金服、字节跳动、PDD,蚂蚁金服面试 Java 后端经历
    react antdesign table 添加滚动加载(下拉翻页功能)
    Redis - 启动
    2022年重庆自考如何报名,有哪些条件和要求?
    Sqoop导入到Hive,Hive使用 HA
  • 原文地址:https://blog.csdn.net/youcheng_ge/article/details/126887161