zoukankan      html  css  js  c++  java
  • 使用反射,查找WCF异常类型

    //使用System.Reflection,查找System.ServiceModel的异常类型
            public void ConsoleException()
            {
                try
                {
                    Assembly asm = Assembly.GetExecutingAssembly();
                    foreach (AssemblyName item in asm.GetReferencedAssemblies())
                    {
                        if (item.Name != "System.ServiceModel") continue;
                        foreach (Type t in Assembly.Load(item).GetTypes())
                        {
                            if (t.Name.EndsWith("Exception"))
                            {
                                Console.WriteLine(t.Name);
                            }
                        }
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine( ex.Message);
                }
            }
       

  • 相关阅读:
    解决跨域之服务器代理http-proxy-middleware模块
    npm、yarn、nrm包管理工具
    nodeJS基础
    gulp自动化构建工具应用
    六种继承方式
    七种去重的方法
    初识模块化
    针对PHP网站攻击的几种方式
    oracle备份恢复(dmp文件)
    nginx.conf中文详解
  • 原文地址:https://www.cnblogs.com/teyond/p/3680371.html
Copyright © 2011-2022 走看看