1、项目中添加CSharp - DllImport.dll、FileSystem.dll
2、添加对CSharp - DllImport.dll的引用。
3、WMAppManifest.xml中加入<Capability
Name="ID_CAP_INTEROPSERVICES" />
4、加入文件WPInteropManifest.xml
内容是
<?xml version="1.0" encoding="utf-8" ?>
<Interop>
</Interop>
确保BuildAction是“Content”
测试代码:
Phone.Screen.CaptureScreenAsImage();
Phone.Vibrator.Vibrate();
Thread.Sleep(300);
Phone.Vibrator.Stop();
CSharp - DllImport.dll、FileSystem.dll下载:http://files.cnblogs.com/rupeng/CSharpDllImport.zip
额外1:
只要zune连接,手机就以通过电脑的ip访问电脑上的socket服务,不
需要通过wifi连接。这样就可以写录像软件了。
额外2:Windows Phone 中读取IMEI码的方法:
http://www.martani.net/2010/12/reading-imei-on-windows-
phone-7-devices.html