本文整理汇总了C#中PlatformID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PlatformID.ToString方法的具体用法?C# PlatformID.ToString怎么用?C# PlatformID.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlatformID
的用法示例。
在下文中一共展示了PlatformID.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOSName
private static string GetOSName(PlatformID platformId)
{
switch (platformId)
{
case PlatformID.Win32Windows:
return "Windows";
case PlatformID.Win32NT:
return "Windows NT";
}
return platformId.ToString();
}
示例2: PlatformUnsupportedException
public PlatformUnsupportedException(PlatformID platformID): base("The current platform is not supported: " + platformID.ToString())
{
PlatFormID = platformID;
}
示例3: GetOSName
private static string GetOSName(PlatformID platformId)
{
string platform;
switch (platformId)
{
case PlatformID.Win32NT: // is this really the only valid option?
platform = "Windows NT";
break;
case PlatformID.Win32Windows:
platform = "Windows";
break;
case PlatformID.Win32S:
case PlatformID.WinCE:
case PlatformID.Xbox:
case PlatformID.MacOSX:
case PlatformID.Unix:
default:
// TODO: should we be doing something more robust here?
platform = platformId.ToString();
break;
}
return (platform);
}