C# CodeDom 双精度类型参考
我可以使用 CodeMethodInvokeExpression
和 CodeTypeReferenceExpression
来调用某种类型,但我希望能够引用以下代码行:
Process p = new Process();
p.StartInfo.FileName = "FilePath";
Here是我到目前为止所得到的 -
CodeVariableDeclarationStatement statement = new CodeVariableDeclarationStatement(typeof(System.Diagnostics.Process), "p",
new CodeObjectCreateExpression("System.Diagnostics.Process",
new CodeExpression[] { }));
我无法弄清楚如何为我的一生生成“p.StartInfo.FileName = exFilePath”行。
任何有关此事的帮助将不胜感激!
谢谢你, 埃文
I am able to make a call to some type by using CodeMethodInvokeExpression
along with CodeTypeReferenceExpression
, but I would like to be able to make a reference to the following line of code:
Process p = new Process();
p.StartInfo.FileName = "FilePath";
Here is what I've got so far -
CodeVariableDeclarationStatement statement = new CodeVariableDeclarationStatement(typeof(System.Diagnostics.Process), "p",
new CodeObjectCreateExpression("System.Diagnostics.Process",
new CodeExpression[] { }));
I cannot figure out how to produce the line "p.StartInfo.FileName = exFilePath" for the life of me.
Any help on the matter would be greatly appreciated!
Thank you,
Evan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
类似
应该做的事情。
Something like
should do.