错误 CS0117:“System.Type"不包含“GetTypeCode"的定义 [英] Error CS0117: 'System.Type' does not contain a definition for 'GetTypeCode'

查看:25
本文介绍了错误 CS0117:“System.Type"不包含“GetTypeCode"的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我学习如何阅读和浏览 msdn 文档吗?

Can someone please help me learn how to read and navigate the msdn docs?

.net 4.0+ 不支持这个吗?

Is this not supported in .net 4.0+ ?

using System;

...

public static bool IsPositive( object Value, bool ZeroIsPositive )
{
    switch ( Type.GetTypeCode( Value.GetType() ) )
    {
        case TypeCode.SByte:

我发现很难通过文档找到自己的方式并知道什么特别适用于 Windows 应用商店应用......

I'm finding it very difficult to find my way through the docs and know what applies to Windows Store Apps specifically...

推荐答案

Type.GetTypeCode() 在完整的 .NET 应用程序和非 Store 可移植类库中受支持,但 在 Windows 应用商店应用中.

Type.GetTypeCode() is supported in full .NET apps and non-Store portable class libraries, but not in Windows Store apps.

如果您查看 Type 类文档.NET 4.5,您可以在 Windows 应用商店应用中支持的所有成员旁边看到一个绿色购物袋.

If you look at the Type class documentation in .NET 4.5, you can see a green shopping bag next to all of the members which are supported in Windows Store apps.

您还可以查看每个成员的页面底部.例如,Type.GetArrayRank 有这个:

You can also look at the bottom of the page for each individual member. For example, Type.GetArrayRank has this:

版本信息
.NET 框架
支持:4.5、4、3.5、3.0、2.0、1.1、1.0
.NET Framework 客户端配置文件
支持:4、3.5 SP1
便携式类库
受支持:可移植类库
适用于 Windows 应用商店应用的 .NET
支持:Windows 8

Version Information
.NET Framework
Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable Class Library
Supported in: Portable Class Library
.NET for Windows Store apps
Supported in: Windows 8

... 而 Type.GetTypeCode有:

... whereas Type.GetTypeCode has:

版本信息
.NET 框架
支持:4.5、4、3.5、3.0、2.0、1.1、1.0
.NET Framework 客户端配置文件
支持:4、3.5 SP1
便携式类库
支持:可移植类库

Version Information
.NET Framework
Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable Class Library
Supported in: Portable Class Library

(注意没有提及 Windows 应用商店.)

(Note the lack of a mention of Windows Store.)

这篇关于错误 CS0117:“System.Type"不包含“GetTypeCode"的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆