zoukankan      html  css  js  c++  java
  • How release file loaded with Assembly.LoadFrom() ?

    load the file into a byte array and use Assembly.Load(byte[]) instead.
            private void GenerateWebserviceAgents()
            
    {
                
    byte[] rawAssembly = LoadFile(webServiceAssemblyPath);
                Assembly ass 
    = Assembly.Load(rawAssembly);
                
    if (ass == nullreturn;

                
    foreach (Type t in ass.GetTypes())
                
    {
                    
                }

            }


            
    // Loads the content of a file to a byte array. 
            static byte[] LoadFile(string filename)
            
    {
                FileStream fs 
    = new FileStream(filename, FileMode.Open);
                
    byte[] buffer = new byte[(int)fs.Length];
                fs.Read(buffer, 
    0, buffer.Length);
                fs.Close();

                
    return buffer;
            }
      
  • 相关阅读:
    vue与laravel
    php artisan 命令
    HTTP 状态码
    PhpStorm提高效率的使用方法及设置
    好RESTful API的设计原则
    laravel 入门基础之安装
    c++ sizeof(字符数组)
    new delete/delete[] 测试
    linux g++ 查找动态链接库
    linux下定时器耗时研究
  • 原文地址:https://www.cnblogs.com/wmz/p/1063167.html
Copyright © 2011-2022 走看看