• 大小: 26.43MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-03
  • 语言: C#
  • 标签: C#  

资源简介

包含消息队列、Autofac接口注入、Aspose.word pdf相关操作

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.IO;
using System.xml;
using System.Runtime.CompilerServices;

namespace GaoQi.ConsoleApp
{
    public static class ModifyInMemory
    {
        private static string AsposeList = “Aspose.3D.dll Aspose.BarCode.dll Aspose.BarCode.Compact.dll Aspose.BarCode.WPF.dll Aspose.Cells.GridDesktop.dll Aspose.Cells.GridWeb.dll Aspose.CAD.dll Aspose.Cells.dll Aspose.Diagram.dll Aspose.Email.dll Aspose.Imaging.dll Aspose.Note.dll Aspose.OCR.dll Aspose.Pdf.dll Aspose.Slides.dll Aspose.Tasks.dll“;

        public static void ActivateMemoryPatching()
        {
            Assembly[] arr = AppDomain.CurrentDomain.GetAssemblies();
            foreach (Assembly assembly in arr)
            {
                if (AsposeList.IndexOf(assembly.FullName.Split(‘‘)[0] + “.dll“) != -1)
                    ActivateForAssembly(assembly);
            }
            AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(Activateonload);
        }

        private static void Activateonload(object sender AssemblyLoadEventArgs e)
        {
            if (AsposeList.IndexOf(e.LoadedAssembly.FullName.Split(‘‘)[0] + “.dll“) != -1)
                ActivateForAssembly(e.LoadedAssembly);
        }

        private static void ActivateForAssembly(Assembly assembly)
        {
            MethodInfo miLicensed1 = typeof(ModifyInMemory).GetMethod(“InvokeMe1“ BindingFlags.NonPublic | BindingFlags.Static);
            MethodInfo miLicensed2 = typeof(ModifyInMemory).GetMethod(“InvokeMe2“ BindingFlags.NonPublic | BindingFlags.Static);
            MethodInfo miEvaluation = null;

            Dictionary miDict = new Dictionary()
            {
                {“System.DateTime“       miLicensed1}
                {“System.xml.xmlElement“ miLicensed2}
            };

            Type[] arrType = null;
            bool isFound = false;
            int nCount = 0;

            try
            {
                arrType = assembly.GetTypes();
            }
            catch (ReflectionTypeLoadException err)
            {
                arrType = err.Types;
            }


            foreach (Type type in arrType)
            {
                if (isFound) break;

                if (type == null) continue;

                MethodInfo[] arrMInfo = type.GetMethods(BindingFlags.NonPublic | BindingFlags.Static);

                foreach (MethodInfo info in arrMInfo)
                {
                    if (isFound) break;

                    try
                    {
                        string strMethod = info.ToString();
                        if ((strMethod.IndexOf(“(System.xml.xmlElement System.String)“) > 0) && (miDict.ContainsKey(info.ReturnType.ToString())))
                        {
      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-20 16:03  GaoQi.ConsoleApp\
     文件        3222  2018-09-20 16:03  GaoQi.ConsoleApp\App.config
     目录           0  2018-09-20 15:24  GaoQi.ConsoleApp\Factory\
     文件       13816  2018-09-20 13:02  GaoQi.ConsoleApp\Factory\Common.cs
     目录           0  2018-09-19 20:14  GaoQi.ConsoleApp\Factory\ITask\
     文件         629  2018-09-19 20:14  GaoQi.ConsoleApp\Factory\ITask\ITask.cs
     目录           0  2018-09-19 20:16  GaoQi.ConsoleApp\Factory\Model\
     文件         955  2018-09-19 20:16  GaoQi.ConsoleApp\Factory\Model\Dictobject.cs
     文件         722  2018-09-19 20:16  GaoQi.ConsoleApp\Factory\Model\SectionModel.cs
     文件         707  2018-09-19 20:16  GaoQi.ConsoleApp\Factory\Model\Task4Model.cs
     文件        1322  2018-09-19 20:16  GaoQi.ConsoleApp\Factory\Model\Task6Model.cs
     文件         637  2018-09-19 20:16  GaoQi.ConsoleApp\Factory\Model\TaskFactoryResult.cs
     文件        9769  2018-09-20 15:24  GaoQi.ConsoleApp\Factory\PdfToImageHelp.cs
     文件        7420  2018-09-20 10:06  GaoQi.ConsoleApp\Factory\Task4Child1.cs
     文件        5120  2018-09-20 09:34  GaoQi.ConsoleApp\Factory\Task6Child1.cs
     文件        8413  2018-09-19 20:15  GaoQi.ConsoleApp\Factory\Task6Child2.cs
     文件        3216  2018-09-19 20:15  GaoQi.ConsoleApp\Factory\Task8Child1.cs
     文件        1979  2018-09-20 09:29  GaoQi.ConsoleApp\Factory\Task9HrEmployee.cs
     文件        3318  2018-09-20 09:17  GaoQi.ConsoleApp\Factory\Taskbase.cs
     文件       13872  2018-09-20 13:49  GaoQi.ConsoleApp\Factory\TaskFactory.cs
     文件        7020  2018-09-19 20:15  GaoQi.ConsoleApp\Factory\TaskSelectPSOrIPFile.cs
     文件        3000  2018-09-19 20:15  GaoQi.ConsoleApp\Factory\TaskUploadFile.cs
     文件        5822  2018-09-20 11:02  GaoQi.ConsoleApp\GaoQi.ConsoleApp.csproj
     文件        9420  2018-09-20 10:41  GaoQi.ConsoleApp\ModifyInMemory.cs
     文件        4247  2018-09-20 15:59  GaoQi.ConsoleApp\PdfService.cs
     文件        1828  2018-09-20 13:06  GaoQi.ConsoleApp\Program.cs
     目录           0  2018-09-19 20:25  GaoQi.ConsoleApp\Properties\
     文件        1461  2018-09-19 20:25  GaoQi.ConsoleApp\Properties\AssemblyInfo.cs
     文件        3092  2018-09-20 11:01  GaoQi.ConsoleApp\app.manifest
     目录           0  2018-09-19 20:13  GaoQi.ConsoleApp\bin\
     目录           0  2018-09-20 16:53  GaoQi.ConsoleApp\bin\Debug\
............此处省略49个文件信息

评论

共有 条评论