2、条件编绎。使用#define Test可以进行条件编绎,如下例:
#define Test
namespace PublishTool
{
class MyMain
{
#if Test
private const string targetPath = @"D:\_My Project\ASP.NET\_NewIBMJob\Test";//测试
private const string targetBin = @"D:\_My Project\ASP.NET\_NewIBMJob\Test\bin";//测试
#else
private const string targetPath = @"D:\_My Project\ASP.NET\_NewIBMJob\Project\IBMWebSite\Con001_ProjectManage\Job";
private const string targetBin = @"D:\_My Project\ASP.NET\_NewIBMJob\Project\IBMWebSite\bin";
#endif
//略去.
}
}
namespace PublishTool
{
class MyMain
{
#if Test
private const string targetPath = @"D:\_My Project\ASP.NET\_NewIBMJob\Test";//测试
private const string targetBin = @"D:\_My Project\ASP.NET\_NewIBMJob\Test\bin";//测试
#else
private const string targetPath = @"D:\_My Project\ASP.NET\_NewIBMJob\Project\IBMWebSite\Con001_ProjectManage\Job";
private const string targetBin = @"D:\_My Project\ASP.NET\_NewIBMJob\Project\IBMWebSite\bin";
#endif
//略去.
}
}