Something like this:
- Code: Select all
using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
public List<AssemblyName> GetReferences(string csfile)
{
List<AssemblyName> returnarray = new List<AssemblyName>();
string[] lines = File.ReadAllLines(csfile);
for(int x = 0; x < lines.Length; x++) {
if(!lines[x].StartsWith("//")) {
break;
}
string file = lines[x].Substring(2);
if(File.Exists(file)) {
returnarray.Add(Assembly.LoadFile(file).GetName());
}
}
return returnarray;
}
And an example command with custom references:
- Code: Select all
//C:\Users\Tom\Desktop\Connor\Minecraft_Server\Classic\MCDzienny\IRCLibrary.dll
using System;
using IRCLibrary;
namespace MCDzienny
{
public class CmdExample : Command
{
}
}