clienttypehelper.cs
来自「破解的飞信源代码」· CS 代码 · 共 92 行
CS
92 行
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 + =
减小字号Ctrl + -
显示快捷键?