有人可以告诉我这是怎么回事..... [英] Can someone please explain to me what this does.....
本文介绍了有人可以告诉我这是怎么回事.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我一直在使用指南来帮助我编写一个基于c#的小型excel应用程序,并且遇到了一行代码,我不知道它是如何执行的.如果有人可以给我一个简短的解释,那会很好.
Hi, I have been using a guide to help me write a small c# based excel application and have come accross a line of code that I have no idea what it acctualy does. IF someone could give me a brief explanation that would be great.
object misValue = System.Reflection.Missing.Value;
xlWorkBook.Close(true,misValue,misValue);
我不太了解misValue的实际作用.
在此先感谢
Dan
I don''t really understand how (what) misValue actually does.
Thanks in advance
Dan
推荐答案
In的意思是: ^ ].
如果使用默认参数功能,则缺少表示默认使用的参数.默认参数在C#v.4中引入,但是该机制本身早已存在.如果省略参数,则等效于传递参数的默认值.但是,通过反射,此参数对于调用者是未知的.该怎么办? 这不是null之类的特殊值.默认参数由要调用的方法的作者指定.通过反射,应传递System.Reflection.Missing.Value
.
—SA
In means this: http://msdn.microsoft.com/en-us/library/system.reflection.missing.aspx[^].
Missing represents a parameter which is used by default if default parameter feature is used. Default parameters were introduced in C# v.4, but the mechanism itself already existed before. If the parameter is omitted, it is equivalent to passing a default value of the parameters. However, through Reflection, this parameter is not known to the caller. What to do? This is no any special value like null. A default parameter is specified by the author of the method to be called. Through Reflection,System.Reflection.Missing.Value
should be passed.
—SA
我认为MSDN中的此页面将对此有所启发:
http://msdn.microsoft.com/en-us/library/system. Reflection.missing.value.aspx [ ^ ]
通常可以在Google的帮助下快速回答此类问题:)
I think this page in the MSDN will shed some light on it:
http://msdn.microsoft.com/en-us/library/system.reflection.missing.value.aspx[^]
Such questions can usually be answered quickly with the help of Google :)
这篇关于有人可以告诉我这是怎么回事.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文