正在进行安全性讨论,以确定下面的以下DEPLOYED代码是否可以到达或"提升"到......即使它是在RELEASE模式下构建的.
思考?
编辑:
我在DotPeek中"看到"它 - 即使在发布后构建.
但是,该文件是"灰显的"
这是否意味着它不会执行?
DotPeek只是"反编译"代码......它没有显示它内置的模式中存在什么代码......对吗?
代码看起来像:
using System;
using System.ServiceProcess;
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
#if DEBUG
var myservice = new StpListener();
myservice.OnDebug();
//KEEP the service alive
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
#else
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new StpListener()
};
ServiceBase.Run(ServicesToRun);
#endif
}
}
Run Code Online (Sandbox Code Playgroud)
这是一个编译时功能.一旦编译器完成了它的工作,你就可以在#if和之间使用代码,#else 或者在#else和之间使用代码#endif.
你永远不会(只要你留下这些项目)产生一个包含两组代码的二进制文件.
| 归档时间: |
|
| 查看次数: |
249 次 |
| 最近记录: |