从主

时间:2018-02-12 11:28:23

标签: winforms c++-cli

我有一个C ++ / CLI WinForms项目,我可以使用以下代码在main中打印出命令行参数

int main(array<System::String ^> ^args)
{
    for each(String^ arg in args) {
        System::Diagnostics::Debug::WriteLine(arg);
    }
}

是否有内置函数允许我在程序期间再次访问这些参数,或者我是否需要自己保存它们?

我见过this question, specifically the second answer表示你可以在C#中执行此操作:

string[] args = Environment.GetCommandLineArgs();

但C ++ / CLI中是否有专门的方法?

1 个答案:

答案 0 :(得分:0)

我的问题的第二部分可以在C ++ / CLI中找到,你可以这样做:

Select
*
From
(SELECT
  PackageCategory + ' Count ' + Cast (Count (UpdatedBy) as varchar) as '9 to 10'
from
  [order] o
  LEFT OUTER JOIN Order_LifeHistory h ON o.pkOrderID = h.fkOrderId
  LEFT OUTER JOIN PackageGroups pg ON o.fkPackagingGroupId = pg.PackageCategoryID
Where
  datepart(hour, dprocessedon) between 9
  and 10
group by
  PackageCategory
) as firstset
FULL JOIN (
SELECT
  PackageCategory + ' Count ' + Cast (Count (UpdatedBy) as varchar) as '9 to 10'
from
  [order] o
  LEFT OUTER JOIN Order_LifeHistory h ON o.pkOrderID = h.fkOrderId
  LEFT OUTER JOIN PackageGroups pg ON o.fkPackagingGroupId = pg.PackageCategoryID
Where
  datepart(hour, dprocessedon) between 10
  and 11
group by
  PackageCategory
)as secondset on firstset.[9 to 10] = secondset.[9 to 10]