How release file loaded with Assembly.LoadFrom() ?
2008-02-03 08:33
483 查看
load the file into a byte array and use Assembly.Load(byte[]) instead.
private void GenerateWebserviceAgents()
// 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;
}
private void GenerateWebserviceAgents()
// 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;
}
相关文章推荐
- C#反射之Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom方法介绍
- C#反射之Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom方法介绍(转)
- Assembly.Load,Assembly.LoadFrom,Assembly.LoadFile的简单用法
- Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom
- Assembly.LoadFile或LoadFrom 后文件不释放
- Assembly.Load()方法,Assembly.LoadFrom()方法,Assembly.LoadFile()方法的区别!
- C#反射之Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom方法介绍
- Assembly.Load()方法,Assembly.LoadFrom()方法,Assembly.LoadFile()方法的区别!
- How to Recover from a Lost or Deleted Datafile with Different Scenarios [ID 198640.1]
- 如何从EXCEL文件加载Hierarchy到BW (How to Load Hierarchy From Flat File)
- How To Load CLOB Data from a File into a CLOB column using PL/SQL
- How to load Properties file from a static block or static method
- “System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 错误
- 慎用Assembly.LoadFile()和Assembly.LoadFrom()
- How to load 3d model from different domain and display it with Three.js
- How to read a PCap file from Wireshark with C++
- C#反射之Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom方法介绍
- Assembly.LoadFrom()和Assembly.LoadFile()的区别
- file /etc/rpm/macros.ghc-srpm from install of epel-release-6-8.noarch conflicts with file from packa
- C#反射之Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom方法介绍