case "SmartPhone":
// Note that the strbuild parameter from the
// PInvoke returns "SmartPhone" with an
// upper case P. The correct casing is
// "Smartphone" with a lower case p.
plat = Platform.Smartphone;
break;
}
return plat;
}
}
public enum Platform {
PocketPC, WindowsCE, Smartphone, Win32NT, Unknown
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace PlatformDetector_CS {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
try {
MessageBox.Show("Платформа: " + PlatformDetector.GetPlatform());