📄 clienttypehelper.cs
字号:
namespace Imps.Common
{
using System;
public class ClientTypeHelper
{
public static bool IsJ2ME(string clientType)
{
if (string.IsNullOrEmpty(clientType))
{
return false;
}
return clientType.ToUpper().Contains("J2ME");
}
public static ClientType String2ClientType(string clientType)
{
clientType = clientType.ToUpper();
switch (clientType)
{
case "PC":
return ClientType.PC;
case "SMARTPHONE":
return ClientType.Smartphone;
case "POCKETPC":
return ClientType.PocketPC;
case "SYMBIAN":
return ClientType.Symbian;
case "J2ME":
return ClientType.J2ME;
case "WAP":
return ClientType.WAP;
case "WEB":
return ClientType.WEB;
case "WV":
return ClientType.WV;
case "POC":
return ClientType.PoC;
case "SYMBIANR1":
return ClientType.SymbianR1;
case "J2MER1":
return ClientType.J2MER1;
}
return ClientType.Smartphone;
}
public static ClientTypeCategory String2ClientTypeCategory(string strClientType)
{
if (string.IsNullOrEmpty(strClientType))
{
return ClientTypeCategory.PC;
}
strClientType = strClientType.ToUpper();
if (strClientType.StartsWith("PC"))
{
return ClientTypeCategory.PC;
}
if (strClientType.StartsWith("WEB"))
{
return ClientTypeCategory.PC;
}
if (strClientType.Contains("WAP"))
{
return ClientTypeCategory.WAP;
}
if (strClientType.StartsWith("MOBILE"))
{
if (strClientType.IndexOf("WAP") > -1)
{
return ClientTypeCategory.WAP;
}
if (strClientType.IndexOf("SMS") > -1)
{
return ClientTypeCategory.SMS;
}
}
return ClientTypeCategory.SmartPhone;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -