zoukankan      html  css  js  c++  java
  • Hello Metro:Windows 8下首个App

    Windows 8 CP发布了,网络一片沸腾。我也来凑个热闹,做了个小应用,供大家分享。

    首先Show一下Windows 8、IE10还有Visual Studio 11的安装界面:

    1.Setup

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

    2.Splash 

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

    3.Metro Template

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

    4.Developer License

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

    5.First C# Metro App

    先睹为快,看看效果吧:

    6.Xaml design (no license) .

    又是这该死的license~ 搞定之后,预览效果如下:

    7.Design UI

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

    8.app manifest (UI)

    9.app manifest (capabilities)

    最终的运行效果如下:

    10.Final screen snapshot

    最后附上源码,不用说了,这是大家最最喜欢的了~

    附件: 332953612419.zip

    另注:关于申请Licnese

    如果电脑直接联网,不使用代理,可以直接点击弹出的对话框,在线获得Develper License。

    如果电脑是通过代理联网,必须使用PowerShell脚本进行Developer Licnese 的申请,脚本代码如下:

    Add-Type @"
    namespace AcquireDeveloper
    {
    using System;
    using System.Runtime.InteropServices;


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

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


    public class Program
    {
    public static void Main(string[] args)
    {
    string machine =
    ".";
    DateTime dt = NativeMethods.AcquireDeveloperLicense(ref machine);

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


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

    }

    "@

    [AcquireDeveloper.Program]::Main($null)





    本文是由葡萄城技术开发团队发布,转载请注明出处:葡萄城官网


  • 相关阅读:
    Business English E-mail
    向数据库更新数据
    遍历DataTable
    Convert SqlDataReader to DataTable
    (十七)map、flatMap和reduce方法的补充
    (4)六顶思考帽
    (3)学习方法思维导图
    (十六)call、apply、bind的实现以及区别
    (十五)关于继承
    (十四)防抖和节流
  • 原文地址:https://www.cnblogs.com/powertoolsteam/p/2381345.html
Copyright © 2011-2022 走看看