找回密码
 立即注册

QQ登录

只需一步,快速开始

thrall

超级版主

11

主题

170

帖子

1867

积分

超级版主

Rank: 8Rank: 8

积分
1867

活字格认证微信认证勋章

thrall
超级版主   /  发表于:2013-5-8 12:05  /   查看:6139  /  回复:0
Windows 8 CP发布了,网络一片沸腾。我也来凑个热闹,做了个小应用,供大家分享。
首先Show一下Windows 8、IE10还有Visual Studio 11的安装界面:


Visual Studio 11 Beta安装完毕,进入Splash界面:


好吧,现在就开始创建首个Metro应用吧。先要选择Metro Template:


哇噢,跳出一个License框!Agree,必须的!



好吧,进入最熟悉的编码界面。上硬菜了~



先睹为快,看看效果吧:
.
又是这该死的license~ 搞定之后,预览效果如下:



运行之前,要配置app manifest,详见下图:









最终的运行效果如下:



最后附上源码,不用说了,这是大家最最喜欢的了~
附件: 332953612419.zip


另注:关于申请Licnese
如果电脑直接联网,不使用代理,可以直接点击弹出的对话框,在线获得Develper License。
如果电脑是通过代理联网,必须使用PowerShell脚本进行Developer Licnese 的申请,脚本代码如下:
  1. Add-Type @"
  2. namespace AcquireDeveloper
  3. {
  4.     using System;
  5.     using System.Runtime.InteropServices;
  6.   

  7.     internal static class NativeMethods
  8.     {
  9.         [DllImport("WSClient.dll", EntryPoint = "CheckDeveloperLicense", SetLastError = true)]
  10.         public static extern int CheckDeveloperLicense(out System.Runtime.InteropServices.ComTypes.FILETIME filetime);         

  11.         [DllImport("WSClient.dll", EntryPoint = "AcquireDeveloperLicense", SetLastError = true)]
  12.         public static extern DateTime AcquireDeveloperLicense(ref string machine);
  13.     }


  14.     public class Program
  15.     {
  16.         public static void Main(string[] args)
  17.         {
  18.             string machine = ".";
  19.             DateTime dt = NativeMethods.AcquireDeveloperLicense(ref machine);

  20.             Console.WriteLine("AcquireDeveloperLicense machine {0}, filetime is {1}", machine, dt.ToString());


  21.             System.Runtime.InteropServices.ComTypes.FILETIME ft;
  22.             int iRet = NativeMethods.CheckDeveloperLicense(out ft);
  23.             long hFT2 = (((long)ft.dwHighDateTime) << 32) + ft.dwLowDateTime;
  24.             DateTime dtExpiry = DateTime.FromFileTime(hFT2);
  25.             Console.WriteLine("CheckDeveloperLicense returned {0}, filetime is {1}", iRet, dtExpiry.ToString());
  26.         }
  27.     }

  28. }

  29. "@

  30. [AcquireDeveloper.Program]::Main($null)
复制代码

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部