1
有没有办法编译或预编译global.asax文件到dll并在bin文件夹中使用它?仅编译/预编译global.asax
我在这个文件中有一个许可证逻辑,其他文件不会被我编译。
我也可以检查dll本身是否存在于bin文件夹中。
void Application_BeginRequest(object sender, EventArgs e)
{
//Application is allowed to run only on specific domains
string[] safeDomains = new string[] { "localhost" };
if(!((IList)safeDomains).Contains(Request.ServerVariables["SERVER_NAME"]))
{
Response.Write("Thisweb application is licensed to run only on: "
+ String.Join(", ", safeDomains));
Response.End();
}
}
这是否比编译你的许可证代码到一个程序集并引用来自global.asax(和/或web.config)更好?我认为那里有实用的东西,所以他们不能只是删除它,没有它的工作? – Rup
反正人们可以反编译它,但这种人非常有限:) –
@HasanGürsoy你有没有时间尝试我建议的方法? –