CommandLine exe参数

 [Verb("OptionsEntity")]
    public class OptionsEntity
    {
        [Option('a', HelpText = "Plantform Advitiser id", MetaValue = "Plantform Advitiser id", Required = false)]
        public string AdvitiserId { get; set; }
        [Option('c', HelpText = "Channel Id (int)", MetaValue = "Channel Id (int)", Required = false)]
        public int ChannelId { get; set; }
        [Option('s', HelpText = "Start Date", MetaValue = "The start date of the download", Required = false)]
        public DateTime StartDate { get; set; }
        [Option('e', HelpText = "End Date", MetaValue = "The end date of the download", Required = false)]
        public DateTime EndDate { get; set; }
        [Option('t', HelpText = "Sync Customer||Account||Campaign", MetaValue = "Sync Customer || Account || Campaign", Required = false)]
        public bool SyncCustomerAccountCampaign { get; set; }

    }

cmd中执行命令

start DownloadDailyReportCsvToHadoop.exe OptionsEntity  -c 1 -s 2018-03-01 -e 2018-03-04 -t true

 

powershell中执行命令:

cmd /c dotnet DVM.Report.DownLoadTools.dll  AppNexusCmd -s %startDate% -e %appNexusEndDate% 

  

 

原文地址:https://www.cnblogs.com/panpanwelcome/p/8510953.html