帮忙看看这几句代码的意思

BenQQQQQQQ 2011-07-08 10:18:25
#region HelloWorld2 使用API的方法判断设备
[DllImport("coredll.dll")]//不懂
private static extern void SystemParametersInfo(uint whichParam, uint size, StringBuilder platformType, uint notUsed);//不懂
const uint SPI_GETPLATFORMTYPE = 257;
public string HelloWorld2()
{
StringBuilder platformTypeString = new StringBuilder(255);
SystemParametersInfo(SPI_GETPLATFORMTYPE, (uint)platformTypeString.Capacity, platformTypeString, 0);
string pltType = platformTypeString.ToString();

return "Hello " + pltType;
}
#endregion



#region HelloWorld3 使用CF的方法判断设备
public string HelloWorld3()
{
string result;
#if PocketPC//不懂
result="Pocket PC";
#elif Smartphone
result= "Smartphone";
#else
result = "World";
#endif
return "Hello " + result;
}

#endregion
...全文
83 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
BenQQQQQQQ 2011-07-09
  • 打赏
  • 举报
回复
现在问题解决了,感谢各位
xuexiaodong2009 2011-07-08
  • 打赏
  • 举报
回复
[DllImport("coredll.dll")]//不懂
导入智能设备的DLL

private static extern void SystemParametersInfo(uint whichParam, uint size, StringBuilder platformType, uint notUsed);//不懂
智能设备的coredll中的函数

#if PocketPC//不懂
条件编译,定义了PocketPC在编译,否则不编译,
bdmh 2011-07-08
  • 打赏
  • 举报
回复
DllImport,引入api函数或其他dll中的函数
搞清楚SystemParametersInfo干什么,你就什么都清楚了
MarsDavid 2011-07-08
  • 打赏
  • 举报
回复
不懂!

17,741

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧