实例介绍
FluentIL:None源码下载
FluentIL是一个帮助开发者使用Emit技术的辅助库,无论你是不是热衷于Emit技术,或者你是否需要它,FluentIL都能提供帮助。作为一个免费开源的社区项目,我们邀请每个人贡献、复制、分享并使用代码。
如果你正在寻找Mono.Cecil集成,请查看FluentIL.Cecil项目。
安装
FluentIL可以通过Nuget进行安装。
获取和构建代码
要构建源代码,你需要按照一定的步骤,但请注意我们这里不提供具体的命令行操作。
示例代码:
var assembly = IL.NewAssembly("hello.exe"); var program = assembly.WithType("Program"); var main = program.WithStaticMethod("Main"); main .Returns(typeof(void)) .WriteLine("Hello World from FluentIL!") .Ret(); assembly.SetEntryPoint(main); assembly.Save();
为什么FluentIL如此惊艳?
使用FluentIL,你不需要考虑如何仅通过跳转和比较来编写复杂的条件语句和循环。FluentIL通过高级抽象封装了所有的复杂性。
示例:利用FluentIL,你可以轻松实现动态方法、条件判断、循环等高级编程操作,而无需深入底层实现细节。
【实例截图】
【核心代码】
文件清单
└── FluentIL-3dc66eebf1d34d6c8cdcad64732b9848d1f3f89a
├── build
│ ├── FluentIL.dll
│ ├── FluentIL.Tests.dll
│ ├── nunit.framework.dll
│ └── SharpTestsEx.dll
├── build.cmd
├── build.xml
├── demo
│ ├── bellevue
│ │ ├── Bellevue
│ │ │ ├── App.config
│ │ │ ├── Bellevue.csproj
│ │ │ ├── Program.cs
│ │ │ ├── Properties
│ │ │ │ └── AssemblyInfo.cs
│ │ │ └── sample.txt
│ │ └── Bellevue.Parser
│ │ ├── AssemblyInfo.fs
│ │ ├── Bellevue.Parser.fsproj
│ │ ├── parser.fs
│ │ └── Script.fsx
│ ├── Cloning
│ │ ├── Cloning.csproj
│ │ ├── ILCloner.cs
│ │ ├── packages.config
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── ShallowTests.cs
│ ├── DynamicProxy
│ │ ├── App.config
│ │ ├── DynamicProxy.csproj
│ │ ├── ExpressionProxyMonitor.cs
│ │ ├── IProxyMonitor.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── ProxyBuilder.cs
│ ├── HelloWorld
│ │ ├── App.config
│ │ ├── HelloWorld.csproj
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
│ ├── ImageProcessing
│ │ ├── AppForm.cs
│ │ ├── AppForm.Designer.cs
│ │ ├── AppForm.resx
│ │ ├── CsApplier.cs
│ │ ├── Filter.cs
│ │ ├── Filters.cs
│ │ ├── IFilterApplier.cs
│ │ ├── IlApplier.cs
│ │ ├── ImageProcessing.csproj
│ │ ├── ImageProcessing.csproj.vs10x
│ │ ├── ImageProcessing.sln
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ └── Util
│ │ └── BitmapExtensions.cs
│ └── TextToExecutable
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── sample.txt
│ └── TextToExecutable.csproj
├── dist
│ ├── FluentIL.1.0.2.nupkg
│ ├── FluentIL.1.0.3.nupkg
│ └── FluentIL.1.0.4.nupkg
├── FluentIL.1.0.2.nuspec
├── FluentIL.1.0.3.nuspec
├── FluentIL.1.0.4.nuspec
├── FluentIL.sln
├── LICENSE.txt
├── nuget
│ ├── FluentIL.1.0.1.nupkg
│ ├── FluentIL.Cecil.0.1.0.nupkg
│ └── FluentIL.Cecil.0.1.1.nupkg
├── README.md
├── src
│ ├── FluentIL
│ │ ├── Emitters
│ │ │ ├── DynamicMethodBody.cs
│ │ │ ├── FluentHelpers
│ │ │ │ ├── DynamicMethodBody.EmitIf.cs
│ │ │ │ ├── DynamicMethodBody.Expression.cs
│ │ │ │ └── DynamicMethodBody.Repeater.cs
│ │ │ ├── IfEmitter.cs
│ │ │ ├── ILEmitter.cs
│ │ │ ├── PropertyEmitter.cs
│ │ │ ├── ReflectionILEmitter.cs
│ │ │ ├── Specialized
│ │ │ │ ├── DynamicMethodBody.Abs.cs
│ │ │ │ ├── DynamicMethodBody.AddToVar.cs
│ │ │ │ ├── DynamicMethodBody.BasicMath.cs
│ │ │ │ ├── DynamicMethodBody.BoxUnbox.cs
│ │ │ │ ├── DynamicMethodBody.Branches.cs
│ │ │ │ ├── DynamicMethodBody.Calls.cs
│ │ │ │ ├── DynamicMethodBody.EnsureLimits.cs
│ │ │ │ ├── DynamicMethodBody.ForNext.cs
│ │ │ │ ├── DynamicMethodBody.Labels.cs
│ │ │ │ ├── DynamicMethodBody.LdArg.cs
│ │ │ │ ├── DynamicMethodBody.Ldc.cs
│ │ │ │ ├── DynamicMethodBody.Ldfld.cs
│ │ │ │ ├── DynamicMethodBody.Locals.cs
│ │ │ │ ├── DynamicMethodBody.Newarr.cs
│ │ │ │ ├── DynamicMethodBody.Newobj.cs
│ │ │ │ ├── DynamicMethodBody.Ret.cs
│ │ │ │ ├── DynamicMethodBody.Stfld.cs
│ │ │ │ ├── DynamicMethodBody.Stloc.cs
│ │ │ │ ├── DynamicMethodBody.Throw.cs
│ │ │ │ ├── DynamicMethodBody.TryCatchFaultFinally.cs
│ │ │ │ └── DynamicMethodBody.WhileLoop.cs
│ │ │ └── T4
│ │ │ ├── DynamicMethodBody.Branches.cs
│ │ │ ├── DynamicMethodBody.Branches.tt
│ │ │ ├── DynamicMethodBody.Emit.cs
│ │ │ ├── DynamicMethodBody.Emit.tt
│ │ │ ├── DynamicMethodBody.Opcodes.cs
│ │ │ └── DynamicMethodBody.Opcodes.tt
│ │ ├── ExpressionInterpreter
│ │ │ ├── ExpressionSimplifierVisitor1.cs
│ │ │ ├── ExpressionSimplifierVisitor.tt
│ │ │ └── ILEmitterVisitor.cs
│ │ ├── ExpressionParser
│ │ │ ├── ExpressionScanner.cs
│ │ │ ├── Parser.cs
│ │ │ ├── ParseResult.cs
│ │ │ ├── Scanner.cs
│ │ │ ├── State.cs
│ │ │ ├── StateTable.cs
│ │ │ └── Token.cs
│ │ ├── FluentIL.csproj
│ │ ├── FluentIL.csproj.user
│ │ ├── FluentIL.csproj.vs10x
│ │ ├── IL.cs
│ │ ├── Infos
│ │ │ ├── DynamicAssemblyInfo.cs
│ │ │ ├── DynamicConstructorInfo.cs
│ │ │ ├── DynamicFieldInfo.cs
│ │ │ ├── DynamicMethodInfo.cs
│ │ │ ├── DynamicPropertyInfo.cs
│ │ │ ├── DynamicTypeInfo.cs
│ │ │ ├── DynamicVariableInfo.cs
│ │ │ ├── ForInfo.cs
│ │ │ ├── IDynamicMethodInfo.cs
│ │ │ └── WhileInfo.cs
│ │ ├── Numbers
│ │ │ ├── ConstantDoubleNumber.cs
│ │ │ ├── ConstantInt32Number.cs
│ │ │ ├── ExpressionNumber.cs
│ │ │ ├── Number.cs
│ │ │ └── ParseExpressionNumber.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
│ └── GlobalInfo.cs
├── test
│ └── FluentIL.Tests
│ ├── ConditionalStudies.cs
│ ├── CounterStudies.cs
│ ├── DynamicMethodInfoTests.cs
│ ├── DynamicTypeInfoTests.cs
│ ├── ExpressionParsingStudies.cs
│ ├── ExpressionScannerTests.cs
│ ├── ExpressionStudies.cs
│ ├── FluentIL.Tests.csproj
│ ├── FluentIL.Tests.csproj.vs10x
│ ├── GetSetStudies.cs
│ ├── IsPrimeStudies.cs
│ ├── MathStudies.cs
│ ├── NewTypeStudies.cs
│ ├── packages.config
│ ├── ParserTests.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── PropertyStudies.cs
│ ├── SayHelloStudies.cs
│ ├── TestSubjects.cs
│ ├── TryCatchFaultFinallyStudies.cs
│ └── VariableStudies.cs
└── util
├── msbuild
│ ├── MSBuild.Community.Tasks.dll
│ ├── MSBuild.Community.Tasks.Targets
│ ├── MSBuild.Community.Tasks.xml
│ └── MSBuild.Community.Tasks.xsd
├── nuget
│ └── nuget.exe
└── nunit
├── nunit-console.exe
├── nunit-console.exe.config
├── nunit-console-runner.dll
├── nunit.core.dll
├── nunit.core.interfaces.dll
├── nunit.framework.dll
└── nunit.util.dll
38 directories, 165 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论