【发布时间】:2016-11-16 13:24:18
【问题描述】:
我正在将 C++ 代码移植到 C#,我在 C++ 代码中遇到了这个问题,
SHELLEXECUTEINFO shell;
memset(&shell, 0, sizeof(shell));
//the properties in shell are set
ShellExecuteEx(&shell);
所以现在我将Process.Start() 和ProcessStartInfo 用于C# 代码。我是否必须为ProcessStartInfo 分配内存,还是在我调用ProcessStartInfo 构造函数时为我完成?只是为了满足我的好奇心,这种在 C++ 中使用memset 的方式是一种非托管语言的实践还是我理解错误?
谢谢。
【问题讨论】:
标签: c# memory-management managed processstartinfo