• 大小: 0.03M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 反射  C#  c  

资源简介

C#反射调用

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class PrivateField
    {
        public delegate bool ReturnBoolHandler(string info);
        public delegate void TestHandler(string msg);
        public event ReturnBoolHandler ReturnBoolEvent;
        public event TestHandler TestEvent;

    }
    class Program
    {
        public static void s_TestEvent(string msg)
        {
            Console.WriteLine(msg);
        }

        static void Main(string[] args)
        {
            Assembly ass = Assembly.Load(“ConsoleApplication1“);

            object structInstance = ass.CreateInstance(“ConsoleApplication1.PrivateField“);

    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        187  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\App.config

     文件       7168  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe

     文件        187  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe.config

     文件      13824  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.pdb

     文件      22984  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe

     文件        187  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.config

     文件        490  2012-06-06 02:06  ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.manifest

     文件       2579  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj

     文件        969  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.csproj.FileListAbsolute.txt

     文件       1753  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.csprojResolveAssemblyReference.cache

     文件       7168  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe

     文件      13824  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.pdb

     文件       6595  2015-12-07 10:43  ConsoleApplication1\ConsoleApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       2045  2015-12-01 11:12  ConsoleApplication1\ConsoleApplication1\Program.cs

     文件       1376  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\Properties\AssemblyInfo.cs

     文件        947  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1.sln

    ..A..H.     33280  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1.v11.suo

     目录          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\obj\Debug\TempPE

     目录          0  2015-12-01 08:42  ConsoleApplication1\ConsoleApplication1\bin\Debug

     目录          0  2016-04-26 09:36  ConsoleApplication1\ConsoleApplication1\obj\Debug

     目录          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\bin

     目录          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\obj

     目录          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1\Properties

     目录          0  2015-12-01 08:25  ConsoleApplication1\ConsoleApplication1

     目录          0  2015-12-01 08:25  ConsoleApplication1

----------- ---------  ---------- -----  ----

               115563                    28

............此处省略1个文件信息

评论

共有 条评论