将数据从var类型转换为Version类型(Convert data from var type to Version type)

编程入门 行业动态 更新时间:2024-10-28 20:27:55
将数据从var类型转换为Version类型(Convert data from var type to Version type)

如何在c#中将var类型的数据转换为Version类型? 我正在使用.net framework 3.5 SP1。

How to convert data from var type to Version type in c#? I am using .net framework 3.5 SP1.

最满意答案

C#中的var不是类型而是关键字。 这意味着变量的类型是从分配给它的任何东西推断出来的。

例如:

var x = new Whatever();

与...完全相同

Whatever x = new Whatever();

在这里阅读更多: http : //msdn.microsoft.com/en-us/library/bb383973.aspx

var in C# is not a type but a keyword. It means the type of the variable is inferred from whatever is assigned to it.

for example:

var x = new Whatever();

is exactly the same as

Whatever x = new Whatever();

read more here: http://msdn.microsoft.com/en-us/library/bb383973.aspx

更多推荐

本文发布于:2023-07-26 16:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1278156.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类型   转换为   数据   var   type

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!