判断当前为Smartphone or Pocket PC
来源:互联网 发布:windows qt开发环境 编辑:程序博客网 时间:2024/04/26 14:12
using System;
using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Text;
namespace Platform
{
internal partial class PInvoke
{
#region Invoke and Enums
/// <summary>
/// to find whether you are running on a Smartphone or a Pocket PC
/// </summary>
/// <param name="uiAction"></param>
/// <param name="uiParam"></param>
/// <param name="pvParam"></param>
/// <param name="fWinIni"></param>
/// <returns></returns>
[DllImport("Coredll.dll", EntryPoint = "SystemParametersInfoW", CharSet = CharSet.Unicode)]
static extern int SystemParametersInfo4Strings(uint uiAction, uint uiParam, StringBuilder pvParam, uint fWinIni);
public enum SystemParametersInfoActions : uint
{
SPI_GETPLATFORMTYPE = 257, // this is used elsewhere for Smartphone/PocketPC detection
}
#endregion
/// <summary>
/// Get Platform Type: Pocket Pc or Windows CE
/// </summary>
/// <returns></returns>
public static string GetPlatformType()
{
StringBuilder platformType = new StringBuilder(50);
if (SystemParametersInfo4Strings((uint)SystemParametersInfoActions.SPI_GETPLATFORMTYPE,
(uint)platformType.Capacity, platformType, 0) == 0)
throw new Exception("Error getting platform type.");
return platformType.ToString();
}
}
/// <summary>
/// Platform Detections methods
/// </summary>
internal partial class PlatformDetection
{
public static bool IsSmartphone()
{
return PInvoke.GetPlatformType() == "SmartPhone";
}
public static bool IsPocketPC()
{
return PInvoke.GetPlatformType() == "PocketPC";
}
}
}
- 判断当前为Smartphone or Pocket PC
- 判断Pocket PC和Smartphone
- pocket pc 工程转化为smartphone 工程
- 理解Pocket PC和SmartPhone
- Pocket PC、Pocket PC phone、Smartphone的区别
- Pocket PC、Pocket PC phone、Smartphone的区别
- Pocket PC、Pocket PC Phone、Smartphone的区别
- 将Pocket PC移植到Smartphone 2002
- WinCE? smartphone? pocket pc? windows mobile?
- SmartPhone和Pocket PC的区别
- WinCE? smartphone? pocket pc? windows mobile?
- 如何维护用于 Pocket PC 和 Smartphone
- 制作 Pocket PC/Smartphone软件安装包
- 在Smartphone/Pocket PC 2003上设置提醒
- 在Smartphone/Pocket PC 2003上设置提醒
- Pocket PC/Smartphone软件安装包之制作DIY
- Pocket PC/Smartphone软件安装包之制作DIY
- 在Smartphone/Pocket PC 2003上设置提醒
- 一个C#操作Excel类,功能比较全。
- SQL语句集锦
- 一个基于c#3.0的开发基于2000/XP/2003下语音识别的通用类
- Linq 演变的过程(delegate => Lambda => Linq)
- .NET资源站点汇总
- 判断当前为Smartphone or Pocket PC
- BAPI_TRANSACTION_COMMIT
- sql与PB程序的优化
- 【转】世行警告中國水資源危機嚴重
- Visual Studio 2008 每日提示(二十七)
- 使用 Hibernate 进行大数据量的性能测试
- SSH登陆错误 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- .net中使用frameset框架
- A Look Inside JBoss Cache