得到程序集所有的资源文件

375 375
C#
sam
sam 2024-05-15 17:40:16

代码

        public static ExeMsgInfo SetProvoiderToExeDir()
        {
            ExeMsgInfo exeMsgInfo = new ExeMsgInfo();

            //得到当前的执行文件
            System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();

            //得到当前程序集所有的资源文件
            string[] resNames = asm.GetManifestResourceNames();

            foreach (string resName in resNames)
            {
                Debug.WriteLine("当前的资源文件是" + resName);
            }

            return exeMsgInfo;
        }

注:

GetExecutingAssembly 表示是当前的执行的程序集

回帖
  • 消灭零回复