Compile to dll : DLL « Windows « C# / CSharp Tutorial






// compile with: csc /r:..\logdriver.dll /target:library logaddintofile.cs
using System;
using System.Collections;
using System.IO;

public class LogAddInToFile
{
    StreamWriter streamWriter;
    
    public LogAddInToFile()
    {
        streamWriter = File.CreateText(@"logger.log");
        streamWriter.AutoFlush = true;
    }
    
    public void Log(string message)
    {
        streamWriter.WriteLine(message);
    }
}








29.11.DLL
29.11.1.Compile to dll
29.11.2.Fiber
29.11.3.Invoke MessageBox in Dll
29.11.4.Using load library from Dll
29.11.5.Call DLL API to move file
29.11.6.Marshal a function from Dll to a delegate