1     2        3         4

创建元素的方法有Element或者SubElement(),前者称作元素的构建函数(constructor),用以构建任一独存的元素; 后者称作元素的制造函数(factory function),用以制造某一元素的子元素。

有了一串元素之后,使用ElementTree类来将其打包,把一串元素转换为xml文件或者从xml文件中解析出来。

若想加快速度,可以使用C语言编译的API xml.etree.cElementTree。

导入ElementTree

在使用xml.etree.ElementTree时,一般都按如下导入:

try:

import xml.etree.cElementTree as ET

except ImportError:

import xml.etree.ElementTree as ET

XML是中结构化数据形式,在ET中使用ElementTree代表整个XML文档,并视其为一棵树,Element代表这个文档树中的 单个节点。

<phone:PhoneApplicationPage
    x:Class="Demo.Others.FastResume"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <StackPanel>
                
            <TextBlock Textrapping="rap">
                <Run>1、什么是快速恢复应用:当你点击 tile 启动了 app 后,再回到开始屏幕,再点击 tile 可以直接恢复应用而不是重新启动应用(p8 新特性)</Run>
                <LineBreak />
                <Run>2、如何实现快速恢复应用:在 manifest 中的 DefaultTask 节点中增加 ActivationPolicy="Resume"</Run>
            </TextBlock>
                
        </StackPanel>
    </Grid>
    www.pf025.com/bzdh/hbjhblxxpfb/yxb/1766.html
www.pf025.com/bzdh/hbjhblxxpfb/yxb/1767.html
www.pf025.com/bzdh/hbjhblxxpfb/yxb/1768.html

</phone:PhoneApplicationPage>
7、App.xaml.cs 的说明
www.pf025.com/bzdh/sszaxpfb/bdf/1785.html
www.pf025.com/bzdh/sszaxpfb/bdf/1786.html
Others/AppXamlCs.xaml
<phone:PhoneApplicationPage
    x:Class="Demo.Others.AppXamlCs"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
www.pf025.com/bzdh/sszaxpfb/bdf/1776.html
www.pf025.com/bzdh/sszaxpfb/bdf/1777.html
www.pf025.com/bzdh/sszaxpfb/bdf/1778.html
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}
www.pf025.com/bzdh/sszaxpfb/bdf/1782.html
www.pf025.com/bzdh/sszaxpfb/bdf/1783.html
www.pf025.com/bzdh/sszaxpfb/bdf/1784.html"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    
    <Grid Background="Transparent">
        <StackPanel>
www.pf025.com/bzdh/sszaxpfb/bdf/1779.html
www.pf025.com/bzdh/sszaxpfb/bdf/1780.html
www.pf025.com/bzdh/sszaxpfb/bdf/1781.html

<TextBlock x:Name="lblMsg" Textrapping="rap">
                <Run>关于 App.xaml.cs 的说明,参见它的注释就好,写得很清楚了

</Run>
www.pf025.com/bzdh/sszaxpfb/bdf/1782.html
www.pf025.com/bzdh/sszaxpfb/bdf/1783.html
www.pf025.com/bzdh/sszaxpfb/bdf/1784.html
                <LineBreak />
                <Run>注意:导航过程中发生异常会通过 RootFrame_NavigationFailed 捕获,其他未处理异常会通过 Application_UnhandledException 捕获</Run>
            </TextBlock>
    
        </StackPanel>
    </Grid>
    
</phone:PhoneApplicationPage>   //  输出日志信息   
    printk("ord_init_exit_success\n");   
}   www.pf025.com/bzdh/hbjhblxxpfb/yxb/1773.html
www.pf025.com/bzdh/hbjhblxxpfb/yxb/1774.html
www.pf025.com/bzdh/hbjhblxxpfb/yxb/1775.html

//  注册初始化Linux驱动的函数   
module_init( ord_count_init);   
//  注册卸载Linux驱动的函数   
module_exit( ord_count_exit);   
       
MODULE_AUTHOR("lining");   
MODULE_DESCRIPTION("statistics of ord count.");   
MODULE_ALIAS("ord count module.");   
MODULE_LICENSE("GPL");
1.Started POST "/posts" for 106.3.102.43 at 2012-10-29 21:16:26 +0800 
02.Processing by PostsController#create as HTML 
03. Parameters: {"utf8"=>"?", "authenticity_token"=>"QG8aU6/V5ZMagzyGhjdbm7fSzr4MB5CKdJeGBIeOa4=", "post"=>{"category_id"=>"1", "title"=>"666666666666", "url"=>"6666666", "picture"=>#<ActionDispatch::::UploadedFile:0x000000032fb838 @original_filename=".gitconfig", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"post[picture]\"; filename=\".gitconfig\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<File:/tmp/RackMultipart20121029-2609-1lrmc9o>>, "content"=>"6666", "tags_attributes"=>{"0"=> {"title"=>""}}}, "commit"=>"Create Post"} 
04.Redirected to 42.121.5.68/posts 
www.pf025.com/bzdh/btfyxpfb/sz/1582.html?1400838295
www.pf025.com/bzdh/btfyxpfb/sz/1583.html?1400838289
/ 向指定的地址发送邮件
            bool success = aait Launcher.LaunchUriAsync(ne Uri("mailto:aaa@xxx.com"));
        }
    
        private async void btnMarketplaceDetail_Click(object sender, RoutedEventArgs e)
        {
            // 打开指定 app 在商店中的详细页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("zune:navigate?appid=02adaaff-ad55-42b4-9ca1-fd4d1dadd32a"));
        }
    
        private async void btnMarketplaceRevie_Click(object sender, RoutedEventArgs e)
        {
            // 在商店中评论指定的 app
            bool success = aait Launcher.LaunchUriAsync(ne Uri("zune:revieapp?appid=02adaaff-ad55-42b4-9ca1-fd4d1dadd32a"));
        }
    
        private async void btnMarketplaceSearch_Click(object sender, RoutedEventArgs e)
        {
            // 在商店中搜索 app(支持按关键字和发行商搜索)
            bool success = aait Launcher.LaunchUriAsync(ne Uri("zune:search?keyord=&publisher=ebabcd&contenttype=app"));
        }
www.h-eq.com/dkdb/1659.html
www.h-eq.com/dkdb/1660.html
www.h-eq.com/dydh/1661.html
    Element e = (Element) nl.item(i);
            // adding each child node to HashMap key => value
            map.put(KEY_ID, parser.getValue(e, KEY_ID));
            map.put(KEY_NAME, parser.getValue(e, KEY_NAME));
            map.put(KEY_COST, "Rs." + parser.getValue(e, KEY_COST));
            map.put(KEY_DESC, parser.getValue(e, KEY_DESC));
    
            // adding HashList to ArrayList
            menuItems.add(map);
        }
    
        // Adding menuItems to ListVie
        ListAdapter adapter = ne SimpleAdapter(this, menuItems,
                R.layout.list_item,
                ne String[] { KEY_NAME, KEY_DESC, KEY_COST }, ne int[] {
                        R.id.name, R.id.desciption, R.id.cost });
    
        setListAdapter(adapter);
    
        // selecting single ListVie item
        ListVie lv = getListVie();
    
        lv.setOnItemClickListener(ne OnItemClickListener() {
    
            @Override
            public void onItemClick(AdapterVie<?> parent, Vie vie,
                    int position, long id) {
                // getting values from selected ListItem
www.h-eq.com/dydh/1662.html
www.h-eq.com/dydh/1663.html
www.h-eq.com/dkdb/1664.html
05.Completed 302 Found in 36ms (ActiveRecord: 30.1ms) 
01.Started POST "/posts" for 123.114.36.100 at 2012-10-30 08:58:13 +0800 
02.Processing by PostsController#create as HTML 
03. Parameters: {"utf8"=>"?", "authenticity_token"=>"rRnhcDYDn+OntxxC2LmIEHpSpjI5glrs6JlprG1Ho=", "post"=>{"category_id"=>"1", "title"=>"博 客尝试最新法宝", "url"=>"post7", "picture"=>#<ActionDispatch::::UploadedFile:0x000000030df9a0 @original_fil
www.h-eq.com/dkdb/1665.html
www.h-eq.com/qcd/1666.html
www.h-eq.com/dydh/1667.html
www.h-eq.com/qcd/1668.html
ename="新浪微博数据挖掘方案.pdf", @content_type="binary/octet- stream", @headers="Content-Disposition: form-data; name=\"post[picture]\"; filename=\"\xE6\x96\xB0\xE6\xB5\xAA\xE5\xBE\xAE\xE5\x8D\x9A\xE6\x95\xB0\xE6\x8D\xAE\xE6 \x8C\x96\xE6\x8E\x98\xE6\x96\xB9\xE6\xA1\x88.pdf\"\r\nContent-Type: binary/octet- stream\r\n", @tempfile=#<File:/tmp/RackMultipart20121030-16129-15agvlb>>, "content"=>"博客尝>试最新法宝", "tags_attributes"=> {"0"=>{"title"=>"博客尝试最新法宝"}}}, "commit"=>"Create Post"} 
04.Completed 500 Internal Server Error in 45ms 
05. 
06.Encoding::UndefinedConversionError ("\xE2" from ASCII-8BIT to UTF-8): 
07. app/controllers/posts_controller.rb:60:in `rite' 
08. app/controllers/posts_controller.rb:60:in `block (2 levels) in create' 
09. app/controllers/posts_controller.rb:59:in `open' 
10. app/controllers/posts_controller.rb:59:in `block in create' 
11. app/controllers/posts_controller.rb:56:in `create'
www.pf025.com/bzdh/btfyxpfb/sz/1584.html?1400838284
www.pf025.com/bzdh/btfyxpfb/sz/1585.html?1400838281
  private async void btnEmailAccount_Click(object sender, RoutedEventArgs e)
        {
            // 跳转到“电子邮件+账户设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-emailandaccounts:"));
        }
    
        private async void btnLockScreen_Click(object sender, RoutedEventArgs e)
        {
            // 跳转到“锁屏设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-lock:"));
        }
    
        private async void btnCallTo_Click(object sender, RoutedEventArgs e)
        {
            // 拨打指定的电话号码
            bool success = aait Launcher.LaunchUriAsync(ne Uri("tel:1391234567"));
            // bool success = aait Launcher.LaunchUriAsync(ne Uri("callto:1391234567"));
        }
    
        private async void btn_Click(object sender, RoutedEventArgs e)
        {
            // 用浏览器打开一个指定的  链接
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ebabcd.cnblogs.com/"));
        }
    
        private async void btnMailTo_Click(object sender, RoutedEventArgs e)
        {
www.pf025.com/bzdh/btfyxpfb/sz/1586.html?1400838279
www.pf025.com/bzdh/btfyxpfb/sz/1587.html?1400838277
private String email;  
          
    //创建日期  
    private Date createDate;  
          
    //接收界面中的选中标记的集合  
    private String[] selectFlag;  
          
    public String getContactTel() {  
        return contactTel;  
    }  
      
    public void setContactTel(String contactTel) {  
        this.contactTel = contactTel;  
    }  
www.lawceo.net/zlzx/by/1011.html
www.lawceo.net/zlzx/by/1012.html
www.lawceo.net/zlzx/by/1013.html
www.lawceo.net/zlzx/by/1014.html
www.lawceo.net/zlzx/by/1015.html

// 跳转到“飞行模式设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-airplanemode:"));
        }
    
        private async void btnBluetooth_Click(object sender, RoutedEventArgs e)
        {
            // 跳转到“蓝牙设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-bluetooth:"));
        }
    
        private async void btnCellular_Click(object sender, RoutedEventArgs e)
        {
            // 跳转到“手机网络设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-cellular:"));
        }
    
        private async void btniFi_Click(object sender, RoutedEventArgs e)
        {
            // 跳转到“iFi设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-ifi:"));
        }
    
        private async void btnLocation_Click(object sender, RoutedEventArgs e)
        {
            // 跳转到“定位设置”页
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-location:"));
        }
www.pf025.net/zlzx/zl/942.html?1400923503
www.pf025.net/zlzx/zl/943.html?1400923494
      
    public Date getCreateDate() {  
        return createDate;  
    }  
      
    public void setCreateDate(Date createDate) {  
        this.createDate = createDate;  
    }  
      
www.lawceo.net/zlzx/by/1007.html
www.lawceo.net/zlzx/by/1008.html
www.lawceo.net/zlzx/by/1009.html
www.lawceo.net/zlzx/by/1010.html
ploaded_io = params[:post][:picture] 
        if uploaded_io != nil and uploaded_io.content_type.match('image') 
     
          File.open(Rails.root.join('public','uploads',uploaded_io.original_filename),'') do

|f| 
/*
 * 演示系统的内置协议(uri 关联)
 * 
 * 
 * 注:系统保留的文件类型和保留的协议类型详见如下链接
 * msdn.microsoft.com/zh-cn/library/indosphone/develop/jj207065
 */
    
using System;
using System.indos;
using Microsoft.Phone.Controls;
using indos.System;
    
namespace Demo.Others
{
    public partial class ReservedProtocol : PhoneApplicationPage
    {
        public ReservedProtocol()
        {
            InitializeComponent();
        }
    
        private async void btnAirplane
     
            f.rite(uploaded_io.read) 
          end 
     
        else
end
www.pf025.com/bzdh/btfyxpfb/pfgm/1763.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1764.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1765.html
uploaded_io = params[:post][:picture] 
        if uploaded_io != nil and uploaded_io.content_type.match('image') 
     
          File.open(Rails.root.join('public','uploads',uploaded_io.original_filename),'b') do

|f| 
     
            f.rite(uploaded_io.read) 
          end 
     
        else
end
<div class="field"> 
  <%= f.label :picture %><br/> 
  <%= f.file_field :picture %> 
</div>
www.pf025.com/bzdh/btfyxpfb/pfgm/1759.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1760.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1761.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1762.html
 public void setUserId(String userId) {  
        this.userId = userId;  
    }  
      
    public String getUserName() {  
        return userName;  
    }  
www.pf025.com/bzdh/btfyxpfb/pfgm/1754.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1755.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1756.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1757.html
www.pf025.com/bzdh/btfyxpfb/pfgm/1758.html
public class AndroidXMLParsingActivity extends ListActivity {
    
    // All static variables
    static final String URL = "10.0.2.2/biyeshejidata/menu.xml";
    // XML node keys
    static final String KEY_ITEM = "item"; // parent node
    static final String KEY_ID = "id";
    static final String KEY_NAME = "name";
    static final String KEY_COST = "cost";
    static final String KEY_DESC = "description";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentVie(R.layout.main);
    
        ArrayList<HashMap<String, String>> menuItems = ne ArrayList<HashMap<String, String>>();
    
        XMLParser parser = ne XMLParser();
        String xml = parser.getXmlFromUrl(URL); // getting XML
        Document doc = parser.getDomElement(xml); // getting DOM element
    
        NodeList nl = doc.getElementsByTagName(KEY_ITEM);
        // looping through all item nodes <item>
www.lawceo.net/zlzx/by/1003.html
www.lawceo.net/zlzx/by/1004.html
www.lawceo.net/zlzx/by/1005.html
www.lawceo.net/zlzx/by/1006.html
    public void setUserName(String userName) {  
        this.userName = userName;  
    }  
      
    public String[] getSelectFlag() {  
        return selectFlag;  
    }  
      
    public void setSelectFlag(String[] selectFlag) {  
        this.selectFlag = selectFlag;  
    }  
}
www.pf025.net/zlzx/by/936.html?1400838311
www.pf025.net/zlzx/by/937.html?1400838310
www.pf025.net/zlzx/by/938.html?1400838308
www.h-eq.com/ttz/1649.html
     type="com.tgb.drp.eb.actions.UserAction"
            name="userForm"
            scope="request"
            parameter="command"
    >  
        <forard name="list_success" path="/user/user_list.jsp"/>  
        <forard name="del_success" path="/user/user_maint.do" redirect="true"/>  
        <forard name="add_success" path="/user/user_maint.do" redirect="true"/>  
        <forard name="modify_success" path="/user/user_maint.do" redirect="true"/>  
        <forard name="find_success" path="/user/user_modify.jsp"/>  
               
    </action>  
<action path="/user/sho_add"
        forard="/user/user_input.jsp"
></action>  
      
www.h-eq.com/ttz/1650.html
www.h-eq.com/ttz/1651.html
www.h-eq.com/ttz/1652.html
session[:user_id] = @current_user.id 
User.find(session[:user_id])
2.2.session id
sessionid是一个32字节的md5哈希值。
sessionid由随机字符串的哈希值组成。随机字符串包括当前时间,0-1之间的随机数,ruby解释器的进程id(也是一个随机数字),一个常量字符串。当目前为止,暴利攻击rails的sessionid是不可行的。MD5是不可逆的,但是可以碰撞,因此创建一个相同哈希值的字符串只是存在理论的可能性。
2.3session劫持

www.pf025.com/bzdh/sszaxpfb/bdf/1591.html?1400923721
www.pf025.com/bzdh/sszaxpfb/bdf/1592.html?1400923718
www.pf025.com/bzdh/sszaxpfb/bdf/1593.html?1400923714

private void LicenseInformationDemo()
        {
            // 当前 app 的许可证信息
            LicenseInformation licenseInformation = CurrentApp.LicenseInformation;
    
            // 许可证ok则为true,否则无许可证或许可证过期则为false
            // licenseInformation.IsActive;  
    
            // 是否是试用许可证
            // licenseInformation.IsTrial;
    
            // 许可证的到期时间
            // licenseInformation.ExpirationDate;
    
            // 许可证状态发生变化时所触发的事件
            // licenseInformation.LicenseChanged;
    
            // 获取此 app 相关的 ProductLicenses 集合
            // licenseInformation.ProductLicenses;
    
    
            // ProductLicense - 产品许可证
            //     ProductId - 产品 ID
            //     IsActive - 此产品许可证ok则为true,否则无此产品许可证或此产品许可证过期则为false
            //     IsConsumable - 产品类型是否是消费型
            //     ExpirationDate - 此产品许可证的到期时间
www.pf025.com/bzdh/sszaxpfb/bdf/1594.html?1400923710
www.pf025.com/bzdh/sszaxpfb/bdf/1595.html?1400923707
偷了一个用户的sessionid之后,一个攻击者就可以用受害者的名义访问eb应用。
很多eb应用都有验证系统:用户提供登陆账号和登录密码,eb应用验证这些信息,验证通过之后,将用户的id保存到session中。在这之后,这个session就是有效的了。每次请求都会加载用户,通过session中的用户id识别用户,不需要再次验证。在cookie的sessionid用来识别session。
因此,cookie为eb应用提供了临时的验证功能。每个从某个人哪里获取cookie的用户,可以以那个人的名义使用eb应用,可能会产生严重的后果。下面是一些劫持session的方法,已经相应的对策。
www.h-eq.com/ttz/1653.html
www.h-eq.com/ttz/1654.html
www.h-eq.com/ttz/1655.html
www.h-eq.com/ttz/1656.html
www.h-eq.com/ttz/1657.html
客户端可以看到在session中存储的所有内容,因为是明文存储(事实上是base64编码,但是没有加密)。当然,你不会在里面存储任何秘密。为了防止session哈希值被篡改,从session中用服务端的密钥计算的一个数字会被插入到cookie的最后面。
这就意味着这种储存方式依赖于这个密钥(和这个数字算法,默认是SHA512,还没有被破解)。因此不使用不重要的密钥,例如字典中的一个单词,或者是短于30个字符。把这个密钥放在你的environment.rb中。
config.action_dispatch.session = { 
  :key    => '_app_session', 
  :secret => '0x0dkfj3927dkc7djdh36rkckdfzsg...'
}
因为CookieStore的继承类加密session哈希值,因此客户端是看不到的。
2.6.重复CookieStore session的攻击
你需要注意的另一种攻击是,在使用CookieStore的时候,受到的重复攻击。
攻击的过程是这样的:
一个用户收到信用卡信息,金额存储在session中(这不是一个好主意,我们只是来证明)。
这个用户买了一些东西。
2.7.固定session
www.h-eq.com/ttz/1658.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3x.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3v.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3u.html
】package com.tgb.drp.eb.forms;  
      
import java.util.Date;  
      
import org.apache.struts.action.ActionForm;  
      
/** 
 * 用户管理ActionForm 
 * 
 */
public class UserActionForm extends ActionForm {  
          
    //用户代码  
    private String userId;  
          
    //用户名称  
    private String userName;  
          
    //密码  
    private String passord;  
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3s.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3r.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3q.html
下面就是一个例子。
<a href=".harmless.com/" οnclick=" 
  var f = document.createElement('form'); 
  f.style.display = 'none'; 
  this.parentNode.appendChild(f); 
  f.method = 'POST'; 
  f.action = '.example.com/account/destroy'; 
  f.submit(); 
www.pf025.com/bzdh/sszaxpfb/bdf/1596.html?1400923704
www.pf025.com/bzdh/sszaxpfb/bdf/1597.html?1400923701
www.pf025.com/bzdh/sszaxpfb/bdf/1598.html?1400923698
www.pf025.com/bzdh/sszaxpfb/bdf/1599.html?1400923696
       
    /** Getting node value
      * @param elem element
      */
     public final String getElementValue( Node elem ) {
         Node child;
         if( elem != null){
             if (elem.hasChildNodes()){
                 for( child = elem.getFirstChild(); child != null; child = child.getNextSibling() ){
                     if( child.getNodeType() == Node.TEXT_NODE  ){
                         return child.getNodeValue();
                     }
                 }
             }
         }
         return "";
     }
     /**
      * Getting node value
      * @param Element node
      * @param key string
      * */
     public String getValue(Element item, String str) {        
            NodeList n = item.getElementsByTagName(str);        
            return this.getElementValue(n.item(0));
        }
}
www.pf025.com/bzdh/sszaxpfb/bdf/1600.html?1400923693
www.pf025.com/bzdh/sszaxpfb/bdf/1601.html?1400923691
www.pf025.com/bzdh/sszaxpfb/bdf/1602.html?1400923686
  return false;">To the harmless survey</a>
在a标签中内嵌了一个form,发送post请求,对数据造成破坏。
攻击代码也可以放在img的mouse事件中。
<img src=".harmless.com/img" idth="400" height="400" οnmοuseοver="..." />
一个应对csrf的办法就是在非get请求中加入token验证,在rails中已经内置了这种方法,只需要在applicationcontroller中加入下面一行代码。默认是已经加好的。
protect_from_forgery :secret => "123456789012345678901234567890..."
4.跳转和文件
在eb应用中,还有一些安全漏洞是与跳转和文件相关
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3p.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3o.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3n.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3m.html
public ActionForard find(ActionMapping mapping, ActionForm form,  
            ServletRequest request, ServletResponse response)  
            thros Exception {  
        //获取从页面表单中提交过来的值  
        UserActionForm uaf = (UserActionForm)form;  
              
        String userId = uaf.getUserId();  
              
        //调用业务逻辑操作  
        User user = UserManager.getInstance().findUserById(userId);  
              
        //将user对象从Action传递到JSP页面  
        request.setAttribute("user", user);  
              
        return mapping.findForard("find_success");  
    }  
          
}
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3k.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3j.html
qing.blog.sina.com.cn/5119197052/13120bf7c33004q3i.html
package com.tgb.drp.eb.actions;  
      
import java.util.Date;  
import java.util.List;  
      
import javax.servlet..ServletRequest;  
import javax.servlet..ServletResponse;  
      
import org.apache.commons.beanutils.BeanUtils;  
import org.apache.struts.action.ActionForm;  
import org.apache.struts.action.ActionForard;  
import org.apache.struts.action.ActionMapping;  
import org.apache.struts.actions.DispatchAction;  
      
import com.tgb.drp.manager.UserManager;  
import com.tgb.drp.model.User;  
import com.tgb.drp.eb.forms.UserActionForm;  
      
public class UserAction extends DispatchAction {  
      
user.qzone.qq.com/1970001032/blog/1400856947
user.qzone.qq.com/1970001032/blog/1400856924
user.qzone.qq.com/1970001032/blog/1400856894
user.qzone.qq.com/1970001032/blog/1400856872
// ListingInformation - 此 app 在 indos 商店中的相关信息
            //     AgeRating - app 的年龄分级            
            //     CurrentMarket - app 的当前商店,如:en-us
            //     Name - app 在当前商店中的名称
            //     FormattedPrice - app 在当前商店中的价格
            //     Description - app 在当前商店中的程序说明
            //     ProductListings - app 在当前商店中的 ProductListing 集合
    
    
            // ProductListing - app 的产品信息
            //     ProductId - 产品 ID
            //     Name - 产品名称
            //     FormattedPrice - 产品当前市场的格式化后的价格
            //     ImageUri - 产品关联的图片的 uri
            //     Description - 产品说明
            //     Keyords - 搜索关键字
            //     ProductType - 产品类型
            //         Unknon - 未知
            //         Durable - 耐用型:用户购买后由用户永远所有的产品)
            //         Consumable - 消费型:可以购买、使用(消耗)和再度购买的产品
            //     Tag - 自定义标记字符串
ody>  
    <a href="user/user_maint.do" title="请点击访问用户管理系统">用户管理系统</a>  
</body>
user.qzone.qq.com/1970001032/blog/1400856835
user.qzone.qq.com/1970001032/blog/1400856784
user.qzone.qq.com/1970001032/blog/1400856763
  @Override
    protected ActionForard unspecified(ActionMapping mapping, ActionForm form,  
            ServletRequest request, ServletResponse response)  
            thros Exception {  
        //调用业务逻辑操作  
        List userList = UserManager.getInstance().findAllUserList();  
        request.setAttribute("userlist", userList);  
              
        return mapping.findForard("list_success");  
    }  
      
    /** 
     * 用户删除 
     * @param mapping 
     * @param form 
     * @param request 
     * @param response 
     * @return 
     * @thros Exception 
     */
user.qzone.qq.com/1970001032/blog/1400856740
user.qzone.qq.com/1970001032/blog/1400856713
user.qzone.qq.com/1970001032/blog/1400856685
user.qzone.qq.com/1970001032/blog/1400856664
/ Prevent recursive

calls  
if ("execute".equals(name) || "perform".equals(name)){  
    String message =  
        messages.getMessage("dispatch.recursive", mapping.getPath());  
      
    log.error(message);  
    thro ne ServletException(message);  
}
所以在给parameter设置值时,不能为execute或perform。
在DispatchAction的 dispatchMethod中,有如下代码:
if (name == null) {  
    return this.unspecified(mapping, form, request, response);  
}
即如果parameter值为空,则执行unspecifi
user.qzone.qq.com/1970001032/blog/1400856634
user.qzone.qq.com/1970001032/blog/1400856611
user.qzone.qq.com/1970001032/blog/1400856587
        ServletRequest request, ServletResponse response)  
            thros Exception {  
        //获取从页面表单中提交过来的值  
        UserActionForm uaf = (UserActionForm)form;  
              
        //取得需要删除的userId的集合  
        String[] userIdList = uaf.getSelectFlag();  
      
        //调用业务逻辑操作  
        UserManager.getInstance().deleteUsers(userIdList);  
        return mapping.findForard("del_success");  
    }  
          
    /** 
     * 用户添加 
     * @param mapping 
     * @param form 
     * @param request 
     * @param response 
     * @return 
     * @thros Exception 
     */
user.qzone.qq.com/1970001032/blog/1400856564
user.qzone.qq.com/1970001032/blog/1400856537
user.qzone.qq.com/1970001032/blog/1400856506
   
    /**
     * Getting XML DOM element
     * @param XML string
     * */
    public Document getDomElement(String xml){
        Document doc = null;
        DocumentBuilderFactory dbf = DocumentBuilderFactory.neInstance();
        try {
    
            DocumentBuilder db = dbf.neDocumentBuilder();
    
            InputSource is = ne InputSource();
                is.setCharacterStream(ne StringReader(xml));
                doc = db.parse(is); 
    
            } catch (ParserConfigurationException e) {
                Log.e("Error: ", e.getMessage());
                return null;
            } catch (SAXException e) {
                Log.e("Error: ", e.getMessage());
                return null;
            } catch (IOException e) {
                Log.e("Error: ", e.getMessage());
                return null;
            }
    
            return doc;
user.qzone.qq.com/1970001032/blog/1400856475
user.qzone.qq.com/1970001032/blog/1400856448
    public ActionForard modify(ActionMapping mapping, ActionForm form,  
            ServletRequest request, ServletResponse response)  
            thros Exception {  
        //获取从页面表单中提交过来的值  
        UserActionForm uaf = (UserActionForm)form;  
        User user = ne User();  
        BeanUtils.copyProperties(user, uaf);  
              
        //调用业务逻辑操作  
        UserManager.getInstance().modifyUser(user);  
        return mapping.findForard("modify_success");  
    }  
          
    /** 
     * 根据ID查询用户 
     *  
     * @param mapping 
     * @param form 
     * @param request 
     * @param response 
     * @return 
     * @thros Exception 
user.qzone.qq.com/1970001032/blog/1400856396
user.qzone.qq.com/1970001032/blog/1400856348
       ServletRequest request, ServletResponse response)  
            thros Exception {  
              
        //获取从页面表单中提交过来的值  
        UserActionForm uaf = (UserActionForm)form;  
        User user = ne User();  
        BeanUtils.copyProperties(user, uaf);  
        user.setCreateDate(ne Date());  
              
        //调用业务逻辑操作  
        UserManager.getInstance().addUser(user);  
        return mapping.findForard("add_success");  }  
      
    /** 
     * 修改用户 
     * @param mapping 
     * @param form 
     * @param request 
     * @param response 
     * @return 
     * @thros Exception 
     */
由于授权问题,在较新的Linux发行版本中都不再包含Oracle Java,取而代之的是OpenJDK。Ubuntu 也是如此。
OpenJDK能满足大部分的应用程序运行条件,但PyCharm无法在OpenJDK条件下运行,因此需要安装 Oracle公司的JDK。
首先到JetBrain官网选择对应操作系统的最新版PyCharm下载。如果使用虚拟机,可以先在主机中用 迅雷下载,然后传输到虚拟机中使用。下载后的文件应该是.tar.gz格式,在Ubuntu中解压到自己选择的 路径后即可使用。
运行方式为在命令行中进入应用根目录,执行:
$ ./bin/pycharm.sh
因为我的是新做的虚拟机,命令行提示JDK错误。
安装JDK
在Ubuntu中安装JDK有不同方法,这里提供一种个人觉得最简单的方法,使用apt安装。
因为版权问题,在Ubuntu的APT仓库中不提供Oracle Java下载,执行以下命令查看:
$ apt-cache search oracle-java
搜索不到任何包,再次查看:
$ apt-cache search java7
default-jdk - Standard Java or Java compatible Development Kit
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
openjdk-7-jdk - OpenJDK Development Kit (JDK)
openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
只可以搜索到OpenJDK的相关包。
因为授权问题,Oracle JDK不包含在官方的PPA列表中,但感谢那些自由软件的贡献者,他们制作了 一个PPA可以从Oracle官方下载最新版JDK到本地,自动安装和升级。注意的是这个PPA是一个alpha版本 ,作者不承诺任何保障,使用者自己承担风险。(PPA:Personal Package Archive)
执行以下命令添加PPA,然后更新APT。
sudo add-apt-repository ppa:ebupd8team/java
sudo apt-get update
更新完成后再搜索一下JDK包:
$ sudo apt-cache search oracle-java
oracle-jdk7-installer - Oracle JDK7 Installer meta package
oracle-java7-installer - Oracle Java(TM) Development Kit (JDK) 7
oracle-java6-installer - Oracle Java(TM) Development Kit (JDK) 6
oracle-java8-installer - Oracle Java(TM) Development Kit (JDK) 8
oracle-java7-set-default - Set Oracle JDK 7 as default Java
oracle-java6-set-default - Set Oracle JDK 6 as default Java
oracle-java8-set-default - Set Oracle JDK 8 as default Java
搜索到了最新的JDK,我选择了安装Java7,执行:
sudo apt-get install oracle-java7-installer
安装都是自动完成的,中间会弹出提示要求接受Oracle的授权条款,全部同意就可以了。
如果需要设置环境变量可以执行:
sudo apt-get install oracle-java7-set-default
如果安装过oracle-java6-set-default或者oracle-java8-set-default,它们将被自动替换为当前的 设置。
好了,再次运行PyCharm试试吧,执行:
www.h-eq.com/qb/1669.html
www.h-eq.com/qb/1670.html
www.h-eq.com/qb/1671.html
 // CurrentApp.GetAppReceiptAsync();
    
            // 获取此 app 的指定产品的购买记录
            // CurrentApp.GetProductReceiptAsync();
    
            // 获取此 app 的 ListingInformation 信息
            // CurrentApp.LoadListingInformationAsync();
    
            // 获取此 app 的指定关键字的 ListingInformation 信息
            // CurrentApp.LoadListingInformationByKeyordsAsync();
    
            // 获取此 app 的指定产品 Id 的 ListingInformation 信息
            // CurrentApp.LoadListingInformationByProductIdsAsync();
    
            // 通知商城本 app 已将指定产品 Id 的产品交付给了用户,在调用此方法之前,用户不能再次购买此产品
            // CurrentApp.ReportProductFulfillment();
    
    
www.h-eq.com/qb/1672.html
www.h-eq.com/qb/1673.html
++++++++++
+ User name +
++++++++++
EMBRACE
    
+++++++++++
+  License Key +
+++++++++++
14203-12042010
0000107Iq75C621P7X1SFnpJDivKnX
6zcYOYaGK3euO3ehd1MiTT"2!Jny8
bff9VcTSJk7sRDLqKRVz1XGKbMq3G
 PyCharm 3.0.1第一次打开时,会自动询问是否要创建桌面快捷方式和Laucher。
Please enter your passord to create a desktop entry
    
[sudo] passord for ifantastic: 
    
Press Enter to close this indo...
    
    
Please enter your passord to create a launcher script in a '/usr/local/bin'
    
[sudo] passord for ifantastic: 
    
Press Enter to close this indo...
www.h-eq.com/qb/1674.html
www.h-eq.com/qb/1675.html
www.h-eq.com/qb/1676.html
   LicenseInformationDemo();
        }
    
        private void CurrentAppDemo()
        {
            // 由 indos 商店创建的此 app 的 id
            // CurrentApp.AppId;
    
            // 获取此 app 在 indos 商店中的 URI 地址
            // CurrentApp.LinkUri;
    
            // 获取当前 app 的 LicenseInformation 对象
            // CurrentApp.LicenseInformation;
    
            // 请求应用程序内购买完整许可证(p 目前不可用)
            // CurrentApp.RequestAppPurchaseAsync();
    
            // 请求应用程序内购买指定产品的许可证
            // CurrentApp.RequestProductPurchaseAsync
    
            // 获取此 app 的全部购买记录(p 目前不可用)
www.h-eq.com/qb/1677.html
www.pf025.net/zlzx/by/950.html?1401005212
www.pf025.net/zlzx/by/951.html?1401005208
www.pf025.net/zlzx/by/952.html?1401005205
使用命令
lsh -C netork
查看自己的网卡驱动。
下面详细介绍一下替换驱动的步骤。主要参考[1]。
具体步骤
1. 阻止原有驱动的加载
为了使用新驱动,我们需要屏蔽掉原有驱动。编辑/etc/modprobe.d/blacklist
sudo vim /etc/modprobe.d/blacklist
在blacklist文件中加入
# blacklist ne il3945
blacklist il3945
2. 安装ip3945 microcode
下载ip3945 microcode,下载地址
解压缩之后,将得到的ip3945.ucode文件,拷贝到/lib/firmare/2.6.24-19-generic/下。
注意,我这里的内核版本是2.6.24-19,请根据自己的情况,将这个数字替换为当前内核版本号。可 以使用“uname -r”命令查看当前内核版本。
sudo cp ip3945.ucode /lib/firmare/2.6.24-19-generic/
3. 安装ip3945 Regulatory daemon
下载ip3945 Regulatory daemon,下载地址
解压缩后,将x86(如果是64位机器,则是x86_64)下的ip3945d拷贝到/sbin目录下。
cp x86/ip3945d /sbin
为了让ip3945d工作,需要进行一些操作,这些操作已经写在了两个文件中,分别是ip3945d-start 和ip3945d-stop中。我们需要将这些文件拷贝到/sbin下,执行如下命令:
sudo cp ip3945d-{start,stop} /sbin
sudo chmod a+x /sbin/ip3945d-{start,stop}
更详细的说明,请参考README.ip3945d
4. 安装ieee80211
一般在内核中都有,特别是ubuntu安装的内核中。所以我就不需要安装。如果你内核中没有 ieee80211,需要安装。请参考ieee80211.sf.net/。一般ubuntu用户都可以跳过这个步骤。
5. 下载ip3945 1.2.2
下载地址,要下载1.2.2版本。如果链接不能下载,可以在本文的附件中下载。得到ip3945- 1.2.2.tgz
6. 下载ip3945补丁
下载地址。这个是一个文本文件,请直接点击右键另存为。得到ip3945-1.2.2.patch文件。
7. 打补丁
解压缩ip3945-1.2.2.tgz文件,将ip3945-1.2.2.patch文件拷贝到ip3945-1.2.2.tgz解压缩后的 目录下,运行patch命令
patch -p1 < ip3945-1.2.2.patch
提示输入文件名的时候,输入ip3945.h
www.pf025.net/zlzx/by/953.html?1401005203
www.pf025.net/zlzx/by/954.html?1401005200
www.pf025.net/zlzx/by/955.html?1401005197
www.pf025.net/zlzx/by/956.html?1401005194
Service是Android的四大组件之一,这里就不再过多的去描述,下面主要实现启动应用时候利用 service后台执行计划任务,退出应用后,关闭service,只存在整个应用的周期中。
首先使用service需要在manifest中的Application 中注册
<service android:name=".xService" android:enabled="true" android:exported="true" >
 </service>
写一个xService类,继承于Service,然后实现它的一些方法。
public class xService extends Service{
    
    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }
    
    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();
        Timer timer = ne Timer();
        timer.schedule(ne ork(),0, 30000);
            
    }
    
    @Override
    public void onStart(Intent intent, int startId) {
        // TODO Auto-generated method stub
        super.onStart(intent, startId);
    }
}
在onCreate()方法中去调度计划,下面介绍一个这个Schedule类。
public void schedule(TimerTask task,
                     long delay,
                     long period)
Schedules the specified task for repeated fixed-delay execution, beginning after the

specified delay. Subsequent executions take place at approximately regular intervals

separated by the specified period.
In fixed-delay execution, each execution is scheduled relative to the actual execution time

of the previous execution. If an execution is delayed for any reason (such as garbage

collection or other background activity), subsequent executions ill be delayed as ell. In

the long run, the frequency of execution ill generally be slightly loer than the

reciprocal of the specified period (assuming the system clock underlying Object.ait(long)

is accurate).
www.pf025.net/zlzx/by/957.html?1401005191
www.pf025.net/zlzx/by/958.html?1401005189
/  需要设置read和rite成员变量,系统才能调用处理读写设备文件动作的函数   
static struct file_operations dev_fops =   
{ .oner = THIS_MODULE, .read = ord_count_read, .rite = ord_count_rite };   
       
//  描述设备文件的信息   
static struct miscdevice misc =   
{ .minor = MISC_DYNAMIC_MINOR, .name = DEVICE_NAME, .fops = &dev_fops };   
       
//  初始化Linux驱动   
static int ord_count_init(void)   
{   
    int ret;   
    //  建立设备文件   
    ret = misc_register(&misc);   
    //  输出日志信息   
    printk("ord_count_init_success\n");   
    return ret;   
}   
       
// 卸载Linux驱动   
static void ord_count_exit(void)   
{   
www.pf025.net/zlzx/by/959.html?1401005187
www.pf025.com/bzdh/pffsqjb/jzb/1603.html?1401005440
www.pf025.com/bzdh/pffsqjb/jzb/1614.html?1401005408
Fixed-delay execution is appropriate for recurring activities that require

"smoothness." In other ords, it is appropriate for activities here it is more

important to keep the frequency accurate in the short run than in the long run. This

includes most animation tasks, such as blinking a cursor at regular intervals. It also

includes tasks herein regular activity is performed in response to human input, such as

automatically repeating a character as long as a key is held don.
    
Parameters:
task - task to be scheduled.
delay - delay in milliseconds before task is to be executed.
period - time in milliseconds beteen successive task executions.
Thros:
IllegalArgumentException - if delay is negative, or delay + System.currentTimeMillis() is

negative.
IllegalStateException - if task as already scheduled or cancelled, timer as cancelled, or

timer thread terminated.
说明:该方法会在指定的延时后执行任务,并且在设定的周期定时执行任务。
www.pf025.com/bzdh/pffsqjb/jzb/1604.html?1401005437
www.pf025.com/bzdh/pffsqjb/jzb/1605.html?1401005432
当前位置: 编程入门 > 操作系统 > 手机系统 > 正文
indos phone的回退事件与android的回退事件有什么区别
时间:2014-03-18

public void onBackPressed() {
    finish();
}
如果要做一个页面导航的功能的话,就我而言,认为,indos phone开发比android更加人性化,更 加傻瓜化能够后退键保存相应的数据啊。
不是吗,indos phone 导航更加傻瓜,因为微软的api中直接有一个goback的方法,能够使你回到 相应的后退界面,因为他航到 Back 堆栈中的最新条目。 如果 Back 堆栈中没有任何条目,则此方法将 引发异常;在调用此方法前,始终都要检查 CanGoForard。 这是由于一个页面毡对相应的page进行了 管理,自愿遵守先进后出的原理也很好管理。而android中activity本身也有一个栈对象对相应的 activity进行了管理,自愿后退时候,也能够进行了后退。想法是很好的,但现实是残酷的。你看我们 android程序员必须在onkey事件中对相应的事件进行监听,判断他按下是不是back键来回退按钮。 这里 事件是activity必须要实现传递,来截获这个后退按下的事件。我这里重点要提出一个问题,onKeyDon 事件究竟是一层层实现back事件的.android 就是比.net好啊!开源,看源代码。
需调用activity中的onKeyDon事件,他的源代码如何: 这是我们定义到了activity中的onKeyDon 事件,他的源代码是这样子的:
if (keyCode == KeyEvent.KEYCODE_BACK) {
            if (getApplicationInfo().targetSdkVersion
                    >= Build.VERSION_CODES.ECLAIR) {
                event.startTracking();
            } else {
                onBackPressed();
            }
            return true;
        }
判断其目标版本是不是比本版本大的的话,就调用event.startTracking()方法,对 event.startTracking()方法跟踪,发现他总是相隔了一段时间进行调用。
否则的话,就调用onbackPressed方法。这个方法又是个怎么鸟样。源代码如下:
   public void onBackPressed() {
       finish();
   }
www.pf025.com/bzdh/pffsqjb/jzb/1606.html?1401005430
www.pf025.com/bzdh/pffsqjb/jzb/1607.html?1401005426
class ork extends TimerTask{
    
        @Override
        public void run() {
            // TODO Auto-generated method stub
        Message message = ne Message();
        message.hat=1;
        handler.sendMessage(message);
        } 
     }
         
     Handler handler = ne Handler()
     {
    
        @Override
        public void handleMessage(Message msg) {
            // TODO Auto-generated method stub
            super.handleMessage(msg);
            if(msg.hat==1)
            {
                ne Updata().execute();
            }
        }
             
www.pf025.com/bzdh/pffsqjb/jzb/1608.html?1401005423
www.pf025.com/bzdh/pffsqjb/jzb/1609.html?1401005420
www.pf025.com/bzdh/pffsqjb/jzb/1610.html?1401005418
ublic void finish() {
        if (mParent == null) {
            int resultCode;
            Intent resultData;
            synchronized (this) {
                resultCode = mResultCode;
                resultData = mResultData;
            }
            if (Config.LOGV) Log.v(TAG, "Finishing self: token=" + mToken);
            try {
                if (ActivityManagerNative.getDefault()
                    .finishActivity(mToken, resultCode, resultData)) {
                    mFinished = true;
                }
            } catch (RemoteException e) {
                // Empty
            }
        } else {
            mParent.finishFromChild(this);
www.pf025.com/bzdh/pffsqjb/jzb/1611.html?1401005415
www.pf025.com/bzdh/pffsqjb/jzb/1612.html?1401005413
www.pf025.com/bzdh/pffsqjb/jzb/1613.html?1401005411
个url,在代码中通过这样的一个方法实现
public String getXmlFromUrl(String url) {
        String xml = null;
        try {
            // defaultClient
            DefaultClient Client = ne DefaultClient();
            Post Post = ne Post(url);
            Response Response = Client.execute(Post);
            Entity Entity = Response.getEntity();
            xml = EntityUtils.toString(Entity,"utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        // return XML
        return xml;
    }   public XMLParser() {
    
    }
    www.h-eq.com/qb/1669.html
www.h-eq.com/qb/1670.html
www.h-eq.com/qb/1671.html
www.h-eq.com/qb/1672.html
    printk("read count:%d", (int) ritten_count);   
        //  设置数据已读状态   
        read_flag = 'y';   
        return ritten_count;   
    }   
    //  已经从设备文件读取数据,不能再次读取数据   
    else
    {      
        return 0;   
    }   
}   
//  向设备文件写入数据时调用该函数   
//  file:指向设备文件、buf:保存写入的数据   count:写入数据的字节数  ppos:写入数据的偏移量   
static ssize_t ord_count_rite(struct file *file, const char __user *buf, size_t count, loff_t *ppos)   
{      
    //  将用户空间的数据复制到内核空间,mem中的数据就是向设备文件写入的数据   
    copy_from_user(mem, buf, count);   
    //  设置数据的未读状态   
    read_flag = 'n';   
    //  保存写入数据的字节数   
    ritten_count = count;   
    //  向日志输出已写入的字节数   
    printk("ritten count:%d", (int)count);   
www.h-eq.com/qb/1673.html
www.h-eq.com/qb/1674.html

/**
     * Getting XML from URL making  request
     * @param url string
     * */
    public String getXmlFromUrl(String url) {
        String xml = null;
        try {
            // defaultClient
            DefaultClient Client = ne DefaultClient();
            Post Post = ne Post(url);
            Response Response = Client.execute(Post);
            Entity Entity = Response.getEntity();
            xml = EntityUtils.toString(Entity,"utf-8");
www.h-eq.com/qb/1675.html
www.h-eq.com/qb/1676.html
www.h-eq.com/qb/1677.html
#include <linux/module.h>   
#include <linux/init.h>   
#include <linux/kernel.h>   
#include <linux/fs.h>   
#include <linux/miscdevice.h>   
#include <asm/uaccess.h>   
       
#define DEVICE_NAME "ordcount"         //  定义设备文件名   
static unsigned char mem[10000];                //  保存向设备文件写入的数据   
static char read_flag = 'y';                    //  y:已从设备文件读取数据   n:未从设备文件读取数据   
static int ritten_count = 0;                   // 向设备文件写入数据的字节数   
       
//  从设备文件读取数据时调用该函数   
//  file:指向设备文件、buf:保存可读取的数据   count:可读取的字节数  ppos:读取数据的偏移量   
static ssize_t ord_count_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)   
{      
    //  如果还没有读取设备文件中的数据,可以进行读取   
    if(read_flag == 'n')   
    {      
        //  将内核空间的数据复制到用户空间,buf中的数据就是从设备文件中读出的数据   
        copy_to_user(buf, (void*) mem, ritten_count);   
www.pf025.net/zlzx/by/950.html?1401005212
www.pf025.net/zlzx/by/951.html?1401005208
www.pf025.net/zlzx/by/952.html?1401005205

} catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        // return XML
    String name = ((TextVie) vie.findVieById(R.id.name)).getText().toString();
                String cost = ((TextVie) vie.findVieById(R.id.cost)).getText().toString();
                String description = ((TextVie) vie.findVieById(R.id.desciption)).getText().toString();
                    www.pf025.net/zlzx/by/953.html?1401005203
www.pf025.net/zlzx/by/954.html?1401005200
www.pf025.net/zlzx/by/955.html?1401005197
www.pf025.net/zlzx/by/956.html?1401005194
1.package com.idea.org;
02.
03.import java.util.ArrayList;
04.import java.util.HashMap;
05.
06.import android.app.Activity;
07.import android.os.Bundle;
08.import android.vie.Vie;
09.import android.idget.AdapterVie;
10.import android.idget.AdapterVie.OnItemClickListener;
11.import android.idget.ListVie;
12.import android.idget.SimpleAdapter;
13.import android.idget.Toast;
14.
15.public class Android_ListVie extends Activity {
16.    /** Called hen the activity is first created. */
17.    @Override
www.pf025.net/zlzx/by/957.html?1401005191
www.pf025.net/zlzx/by/958.html?1401005189
www.pf025.net/zlzx/by/959.html?1401005187

// Starting ne intent
                Intent in = ne Intent(getApplicationContext(), SingleMenuItemActivity.class);
                in.putExtra(KEY_NAME, name);
                in.putExtra(KEY_COST, cost);
                in.putExtra(KEY_DESC, description);
                startActivity(in);
    
            }
        });
    }
}public class SingleMenuItemActivity  extends Activity {
        
    // XML node keys
    static final String KEY_NAME = "name";
    static final String KEY_COST = "cost";
    static final String KEY_DESC = "description";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentVie(R.layout.single_list_item);
            www.pf025.com/bzdh/pffsqjb/jzb/1603.html?1401005440
www.pf025.com/bzdh/pffsqjb/jzb/1614.html?1401005408
www.pf025.com/bzdh/pffsqjb/jzb/1604.html?1401005437
www.pf025.com/bzdh/pffsqjb/jzb/1605.html?1401005432
    public void onCreate(Bundle savedInstanceState) {
19.        super.onCreate(savedInstanceState);
20.        setContentVie(R.layout.main);
21.        ArrayList<HashMap<String,String>>list =ne ArrayList<HashMap<String,String>>();
22.        HashMap<String,String> map1=ne HashMap<String,String>();
23.        HashMap<String,String> map2=ne HashMap<String,String>();
24.        HashMap<String,String> map3=ne HashMap<String,String>();
25.        ListVie listVie=(ListVie)findVieById(R.id.listVie);
26.        map1.put("userId", "100001");
27.        map1.put("userName", "用户一");
28.        list.add(map1);
29.        map2.put("userId", "100002");
30.        map2.put("userName", "用户二");
31.        list.add(map2);
32.        map3.put("userId", "100003");
33.        map3.put("userName", "用户三");
34.        list.add(map3);
35.        //定义一个SimpleAdapter,每一个行有两个TextVie,分别显示userId和userName
36.        SimpleAdapter simpleAdapter=ne SimpleAdapter(this,list,R.layout.user,
37.                ne String[]{"userId","userName"},ne int[]{R.id.userId,R.id.userName});
38.        //为ListVie添加适配器
39.        listVie.setAdapter(simpleAdapter);//设置listVie背后的数据为simpleAdapter。
40.        /*为listVie添加单击监听器,需要import android.idget.AdapterVi
www.pf025.com/bzdh/pffsqjb/jzb/1606.html?1401005430
www.pf025.com/bzdh/pffsqjb/jzb/1607.html?1401005426

// getting intent data
        Intent in = getIntent();
            
        // Get XML values from previous intent
        String name = in.getStringExtra(KEY_NAME);
        String cost = in.getStringExtra(KEY_COST);
        String description = in.getStringExtra(KEY_DESC);
            
        // Displaying all values on the screen
        TextVie lblName = (TextVie) findVieById(R.id.name_label);
        TextVie lblCost = (TextVie) findVieById(R.id.cost_label);
        TextVie lblDesc = (TextVie) findVieById(R.id.description_label);
            
        lblName.setText(name);
www.pf025.com/bzdh/pffsqjb/jzb/1608.html?1401005423
www.pf025.com/bzdh/pffsqjb/jzb/1609.html?1401005420
01.<?xml version="1.0" encoding="utf-8"?>
02.<LinearLayout xmlns:android="schemas.android.com/apk/res/android"
03.    android:orientation="vertical"
04.    android:layout_idth="fill_parent"
05.    android:layout_height="rap_content"
06.    >
07.    <!--添加一个ListVie控件  -->
08.    <ListVie
09.        android:id="@+id/listVie"
10.        android:layout_idth="fill_parent"
11.        android:layout_height="rap_content"
12.        />
13.</LinearLayout>
www.pf025.com/bzdh/pffsqjb/jzb/1610.html?1401005418
www.pf025.com/bzdh/pffsqjb/jzb/1611.html?1401005415
      listVie.setOnItemClickListener(ne OnItemClickListener() {
44.
45.            @Override
46.            public void onItemClick(AdapterVie<?> arg0, Vie arg1, int arg2,
47.              long arg3) {
48.             ListVie listVie=(ListVie)arg0;
49.             Toast.makeText(Android_ListVie.this, listVie.getItemAtPosition(arg2).toString(),
50.                     Toast.LENGTH_SHORT).sho();
51.            }
52.           });
53.    }   
54.}
www.pf025.com/bzdh/pffsqjb/jzb/1612.html?1401005413
www.pf025.com/bzdh/pffsqjb/jzb/1613.html?1401005411

lblCost.setText(cost);
        lblDesc.setText(description);
    }
}01.<?xml version="1.0" encoding="utf-8"?>
02.<LinearLayout xmlns:android="schemas.android.com/apk/res/android"
03.    android:orientation="horizontal"
04.    android:layout_idth="fill_parent"
05.    android:layout_height="fill_parent"
06.    android:paddingRight="10dip"
07.    android:paddingLeft="10dip"
08.    android:paddingTop="1dip"
09.    android:paddingBottom="1dip"
www.pf025.com/bzdh/sszaxpfb/tj/1644.html?1401192162
www.pf025.com/bzdh/sszaxpfb/tj/1643.html?1401192165
www.pf025.com/bzdh/sszaxpfb/tj/1641.html?1401192168
8.0 其它: 锁屏信息和锁屏背景, 电池状态, 多分辨率, 商店, 内置协议, 快速恢复
介绍
与众不同 indos phone 8.0 之 其它
锁屏信息和锁屏背景
电池状态
多分辨率应用
与 indos Phone 商店相关的操作
系统的内置协议
快速恢复应用
App.xaml.cs 的说明
manifest 的说明
示例
1、演示如何发送信息到锁屏,以及如何修改锁屏背景
Others/LockScreen.xaml
<phone:PhoneApplicationPage
    x:Class="Demo.Others.LockScreen"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <StackPanel>
                
            <TextBlock Name="lblMsg" Textrapping="rap" />
                
            <Button Name="btnGotoLockScreen" Content="跳转到锁屏设置界面" Click="btnGotoLockScreen_Click" />
    
            <Button Name="btnSendMessageToLockScreen" Content="发送信息到锁屏" Click="btnSendMessageToLockScreen_Click" />
    
            <Button Name="btnLockScreenBackground" Content="修改锁屏背景" Click="btnLockScreenBackground_Click" />
    
        </StackPanel>
    </Grid>
    
</phone:PhoneApplicationPage>
www.pf025.com/bzdh/sszaxpfb/tj/1639.html?1401192171
www.pf025.com/bzdh/sszaxpfb/tj/1637.html?1401192175
/*
 * 演示与 indos Phone 商店相关的操作
 * 
 * 注:
 * 应用内购买测试请参考:msdn.microsoft.com/zh-cn/library/indosphone/develop/jj681689
 */
    
using Microsoft.Phone.Controls;
using indos.ApplicationModel.Store;
    
namespace Demo.Others
{
    public partial class StoreDemo : PhoneApplicationPage
    {
        public StoreDemo()
        {
            InitializeComponent();
    
            CurrentAppDemo();
    
www.pf025.com/bzdh/sszaxpfb/tj/1636.html?1401192179
www.pf025.com/bzdh/sszaxpfb/tj/1635.html?1401192182
/*
 * 演示如何发送信息到锁屏,以及如何修改锁屏背景
 * 
 * 
 * 注:在 manifest 中需要增加的内容和说明如下
 * 1、搜索并修改“<DeviceLockImageURI />”节点的内容如下:
 * <!--锁屏图标:38 * 38 像素,仅支持白色和透明-->
 * <DeviceLockImageURI IsRelative="true" IsResource="false">Assets\LockScreen.png</DeviceLockImageURI>
 * 
 * 2、在 <Extensions /> 节点中增加内容如下:
 * <!--支持锁屏上显示图标和数字-->
 * <Extension TaskID="_default" ExtensionName="LockScreen_Notification_IconCount" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" />
 * <!--支持锁屏上显示文本-->
 * <Extension TaskID="_default" ExtensionName="LockScreen_Notification_TextField" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" />
 * <!--支持锁屏背景的修改-->
 * <Extension TaskID="_default" ExtensionName="LockScreen_Background" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" />
 */
    
using System;
using System.Collections.Generic;
using System.Linq;
using System.indos;
using System.indos.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using indos.System;
using indos.Phone.System.UserProfile;
    
namespace Demo.Others
{
    public partial class LockScreen : PhoneApplicationPage
    {
        public LockScreen()
        {
            InitializeComponent();
        }
    
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // 在锁屏设置界面,如果将本 app 设置为背景提供程序,则锁屏界面上会有一个名为“打开应用”的按钮,点击后会通过 /MainPage.xaml?allpaperSettings=1 启动本 app
            // 相关的 UriMapper 参见 MyUriMapper.cs
    
            IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;
            if (queryStrings.ContainsKey("allpaperSettings"))
                lblMsg.Text = "在锁屏界面启动了本 app,启动的 url 是:" + e.Uri.ToString();
    
            base.OnNavigatedTo(e);
        }
    
        // 跳转到锁屏设置界面
        private async void btnGotoLockScreen_Click(object sender, RoutedEventArgs e)
        {
            bool success = aait Launcher.LaunchUriAsync(ne Uri("ms-settings-lock:"));
        }
    
        // 发送信息到锁屏
        private void btnSendMessageToLockScreen_Click(object sender, RoutedEventArgs e)
        {
            // 锁屏信息来自 tile(StandardTileData, FlipTile, IconicTile, CycleTile 均可)
            ShellTile shellTile = ShellTile.ActiveTiles.First();
            if (shellTile != null)
            {
                StandardTileData tile = ne StandardTileData();
                tile.BackContent = "发送信息到锁屏"; // 需要在锁屏上显示的文本内容(需要在锁屏界面设置本 app 为显示详细状态)
                tile.Count = 10; // 需要在锁屏上显示的数字内容,图标来自 <DeviceLockImageURI /> 节点的设置(需要在锁屏界面设置本 app 为显示即时状态)
    
                shellTile.Update(tile);
            }
        }
    
        // 修改锁屏背景
        private async void btnLockScreenBackground_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                /*
                 * 注:
                 * 在项目根目录下增加 DefaultLockScreen.jpg 文件,用于当 app 成为锁屏背景的实际提供程序却没有设置锁屏背景时,作为锁屏背景的默认图片
                 * 比如用户在锁屏设置页面选择了本 app 作为锁屏背景的实际提供程序,此时本 app 无法设置锁屏背景,那么锁屏背景图就会被设置为项目根目录下的 DefaultLockScreen.jpg 文件
                 */
www.pf025.com/bzdh/sszaxpfb/tj/1634.html?1401192185
www.pf025.com/bzdh/sszaxpfb/tj/1633.html?1401192189
www.pf025.com/bzdh/sszaxpfb/tj/1632.html?1401192192
www.pf025.com/bzdh/sszaxpfb/tj/1631.html?1401192196

// 判断本 app 是否是锁屏背景的实际提供程序
                bool isProvider = LockScreenManager.IsProvidedByCurrentApplication;
                if (!isProvider)
                {
                    // 请求成为锁屏背景的实际提供程序(会弹出一个对话框)
                    LockScreenRequestResult result = aait LockScreenManager.RequestAccessAsync();
    
                    // LockScreenRequestResult.Granted - 用户已允许;LockScreenRequestResult.Denied - 用户已拒绝
                    isProvider = result == LockScreenRequestResult.Granted;
                }
    
                if (isProvider)
                {
                    // 图片地址支持“ms-appx/”和“ms-appdata/Local/”,文件名必须与当前锁屏背景的文件名不同
                    Uri uri = ne Uri("ms-appx/Assets/AppTile.png", UriKind.Absolute);
    
                    // 设置当前锁屏的背景图
                    indos.Phone.System.UserProfile.LockScreen.SetImageUri(uri);
    
                    // 获取当前锁屏的背景图的 uri
                    Uri currentUri = indos.Phone.System.UserProfile.LockScreen.GetImageUri();
                    lblMsg.Text = "当前锁屏的背景图的 url: " + currentUri.ToString();
                }
                else
                {
                    lblMsg.Text = "用户不允许此 app 成为锁屏背景的实际提供程序";
                }
            }
            catch (Exception ex)
            {
                lblMsg.Text = ex.ToString();
            }
        }
    }
}
www.pf025.net/zlzx/zd/970.html?1401192498
www.pf025.net/zlzx/zd/969.html?1401192500
www.pf025.net/zlzx/zd/968.html?1401192502
/*
 * 演示如何获取电池的状态信息
 */
    
using System;
using System.indos.Navigation;
using Microsoft.Phone.Controls;
using indos.Phone.Devices.Poer;
using Microsoft.Phone.Info;
    
namespace Demo.Others
{
    public partial class BatteryDemo : PhoneApplicationPage
    {
        private Battery _battery;
    
        public BatteryDemo()
        {
            InitializeComponent();
        }
    
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // 获取电话的默认 Battery 对象
www.pf025.net/zlzx/zd/967.html?1401192505
www.pf025.net/zlzx/zd/966.html?1401192507
www.pf025.net/zlzx/zd/965.html?1401192509
www.pf025.net/zlzx/zd/964.html?1401192512
_battery = Battery.GetDefault();
    
            // 获取电池在完全用完之前的所剩时间
            TimeSpan remainingTime = _battery.RemainingDischargeTime;
    
            // 获取剩余电量的百分比
            int remainingChargePercent = _battery.RemainingChargePercent;
    
            // 判断当前是电池供电还是外部电源供电
            lblMsg.Text = "PoerSource: " + DeviceStatus.PoerSource.ToString();
            lblMsg.Text += Environment.NeLine;
            lblMsg.Text += "剩余时间:" + string.Format("{0}{1}{2}{3}{4}{5}", remainingTime.Days, "天", remainingTime.Hours, "小时", remainingTime.Minutes, "分");
            lblMsg.Text += Environment.NeLine;
            lblMsg.Text += "电量百分比:" + remainingChargePercent.ToString() + "%";
    
            // 剩余电量的百分比发生变化时所触发的事件
            _battery.RemainingChargePercentChanged += _battery_RemainingChargePercentChanged;
    
            base.OnNavigatedTo(e);
        }
    
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            _battery.RemainingChargePercentChanged -= _battery_RemainingChargePercentChanged;
    
            base.OnNavigatingFrom(e);
        }
    
        void _battery_RemainingChargePercentChanged(object sender, object e)
        {
            // 剩余电量的百分比发生了变化
        }
www.pf025.net/zlzx/zd/963.html?1401192515
www.pf025.net/zlzx/zd/962.html?1401192518
www.pf025.net/zlzx/zd/961.html?1401192521
www.pf025.net/zlzx/zd/960.html?1401192525
<phone:PhoneApplicationPage
    x:Class="Demo.Others.MultiResolution"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <StackPanel>
                
            <TextBlock Textrapping="rap">
                <Run>1、VGA - 480 x 800; XGA - 768 x 1280; 720p - 720 x 1280</Run>
                <LineBreak />
www.h-eq.com/kfz/1678.html
www.h-eq.com/kfz/1679.html
www.h-eq.com/kfz/1681.html
<Run>2、大多数情况下,建议使用 XGA 资产,他们会在其他分辨率下自动缩放且显示良好</Run>
                <LineBreak />
                <Run>3、如果需要不同分辨率使用不同资产,则必须写代码,参见 code-behind 中判断当前分辨率的代码</Run>
                <LineBreak />
                <Run>4、适应不同分辨率的启动屏幕,需要在项目的根目录下放置三个启动屏幕文件:SplashScreenImage.Screen-VGA.jpg, SplashScreenImage.Screen-XGA.jpg, plashScreenImage.Screen-720p.jpg</Run>
                <LineBreak />
                <Run>5、如果只想用一个启动屏幕文件的话,则在项目的根目录下放置一个分辨率为 768 x 1280 的名为 SplashScreenImage.jpg 的文件即可(不同分辨率会自动缩放)

</Run>
            </TextBlock>
    
            <TextBlock Name="lblMsg" Textrapping="rap" Margin="0 10 0 0" />
                
        </StackPanel>
    </Grid>
    
</phone:PhoneApplicationPage>
www.h-eq.com/kfz/1680.html
www.h-eq.com/kfz/1682.html
www.h-eq.com/kfz/1683.html
www.h-eq.com/kfz/1684.html
/*
 * 演示如何获取当前分辨率
 */
    
using System.indos.Navigation;
using Microsoft.Phone.Controls;
    
namespace Demo.Others
{
    public partial class MultiResolution : PhoneApplicationPage
    {
        public MultiResolution()
        {
            InitializeComponent();
        }
    
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // 获取当前的分辨率
            lblMsg.Text = "Resolution: " + ResolutionHelper.CurrentResolution.ToString();
                
            base.OnNavigatedTo(e);
        }
    }
www.h-eq.com/kfz/1685.html
www.h-eq.com/kfz/1686.html
www.h-eq.com/kfz/1687.html
    
    public static class ResolutionHelper
    {
        /// <summary>
        /// 480 x 800
        /// </summary>
        private static bool Isvga
        {
            get
            {
                return App.Current.Host.Content.ScaleFactor == 100;
            }
        }
    
        /// <summary>
        /// 768 x 1280
        /// </summary>
        private static bool Isxga
        {
            get
            {
                return App.Current.Host.Content.ScaleFactor == 160;
            }
        }
    
        /// <summary>
        /// 720 x 1280
        /// </summary>
        private static bool Is720p
        {
            get
            {
                return App.Current.Host.Content.ScaleFactor == 150;
            }
        }
    
        public static Resolution CurrentResolution
www.h-eq.com/kfz/1688.html
www.h-eq.com/kfz/1689.html

10.    >
11.    <!--ListVie的每一项都有两个TextVie,分别显示userId和userName  -->
12.    <TextVie
    android:layout_idth="fill_parent"
15.        android:layout_height="rap_content"
16.        android:textSize="20pt"
17.        android:layout_eight="1"
18.        />
19.    <TextVie
20.        android:id="@+id/userName"
21.        android:layout_idth="fill_parent"
22.        android:layout_height="rap_content"
23.        android:textSize="20pt"
24.        android:layout_eight="1"
25.        />
26.</LinearLayout>
           if (Isvga) 
                    return Resolution.VGA;
                else if (Isxga) 
                    return Resolution.XGA;
                else if (Is720p) 
                    return Resolution.HD720p;
                else
                    return Resolution.Unknon;
            }介绍
与众不同 indos phone 8.0 之 通信
Socket Demo
获取当前连接的信息
 rss odata socket bluetooth nfc voip insock
示例
1、演示 socket tcp 的应用 (本例既做服务端又做客户端)
Communication/SocketDemo.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.Communication.SocketDemo"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <StackPanel>   
                <Button Name="btnStartListener" Content="start a socket listener" Click="btnStartListener_Click" />   
                <Button Name="btnConnectListener" Content="connect to the socket listener" Click="btnConnectListener_Click" Margin="0 10 0 0" />   
                <Button Name="btnSendData" Content="send data" Click="btnSendData_Click" Margin="0 10 0 0" />   
                <Button Name="btnCloseSocket" Content="close server socket and client socket" Click="btnCloseSocket_Click" Margin="0 10 0 0" />   
            </StackPanel>   
       
            <TextBlock Name="lblMsg" Textrapping="rap" Margin="20 0 0 0" />   
       
        </StackPanel>   
    </Grid>   
       *   
 * 演示如何将本 app 注册为图片扩展   
 *    
 *    
 * 1、注册为“共享”扩展:在照片中心的图片的上下文菜单中,单击“共享...”,弹出的 app 列表窗口包含此 app,需要在 manifest 中增加 <Extension TaskID="_default" ExtensionName="Photos_Extra_Share" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" />   
 *    
 * 2、注册为“编辑”扩展:在照片中心的图片的上下文菜单中,单击“编辑...”,弹出的 app 列表窗口包含此 app,需要在 manifest 中增加 <Extension TaskID="_default" ExtensionName="Photos_Extra_Image_Editor" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" />   
 *    p7 时代的做法(与图片的上下文菜单“应用程序...”关联)在 p8 中已经遭到了弃用,参考:.cnblogs.com/ebabcd/archive/2012/07/26/2609357.html    
 *    
 * 3、注册为“Photos_Rich_Media_Edit”扩展:会有以下两个特性,以 app 的名字为“P8 Demo”为例,需要在 manifest 中增加 <Extension TaskID="_default" ExtensionName="Photos_Rich_Media_Edit" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" />   
 *    a) 在照片中心打开由此 app 拍摄的照片时,在屏幕的左下角会有一段文字“由 P8 Demo 拍摄”   
 *    b) 在照片中心打开由此 app 拍摄的照片后,在其上下文菜单中会多出一项“在 P8 Demo 中打

开”   
</phone:PhoneApplicationPage>
www.pf025.net/zlzx/zl/939.html?1400923513
www.pf025.net/zlzx/zl/940.html?1400923509
  <Grid x:Name="LayoutRoot" Background="Transparent">   
        <StackPanel>   
       
            <TextBlock Name="lblMsg" Textrapping="rap" Text="用此 app 照个照片,然后再在照片中心打开该照片,再打开上下文菜单,以查看图片扩展的效果" />   
                   
            <Image Name="img" idth="320" Height="240" Margin="0 10 0 0" />   
                   
        </StackPanel>   
    </Grid>   
       
</phone:PhoneApplicationPage>
CameraAndPhoto/PhotoExtensibility.xaml.cs
www.pf025.net/zlzx/zl/941.html?1400923505
*   
 * 演示 socket tcp 的应用(本例既做服务端又做客户端)   
 *    
 * 通过 StreamSocketListener 实现 tcp 通信的服务端的 socket 监听   
 * 通过 StreamSocket 实现 tcp 通信的客户端 socket   
 *    
 * 注:需要在 manifest 中增加配置 <Capability Name="ID_CAP_NETORKING" />   
 *    
 *    
 * 另:   
 * 本例完全摘自之前写的 in8 socket demo   
 */
       
using System;   
using System.indos;   
using Microsoft.Phone.Controls;   
using indos.Netorking.Sockets;   
using indos.Storage.Streams;   
using indos.Netorking;   
       
namespace Demo.Communication   
www.pf025.net/zlzx/zl/942.html?1400923503
www.pf025.net/zlzx/zl/943.html?1400923494
hone:PhoneApplicationPage   
    x:Class="Demo.CameraAndPhoto.PhotoExtensibility"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
www.pf025.net/zlzx/zl/944.html?1400923492
www.pf025.net/zlzx/zl/945.html?1400923489
   public partial class SocketDemo : PhoneApplicationPage   
    {   
        /// <summary>   
        /// 服务端 socket   
        /// </summary>   
        private StreamSocketListener _listener;   
       
        /// <summary>   
        /// 客户端 socket   
        /// </summary>   
        private StreamSocket _client;   
       
        /// <summary>   
        /// 客户端向服务端发送数据时的 Datariter   
        /// </summary>   
        private Datariter _riter;   
       
        public SocketDemo()   
        {   
            this.InitializeComponent();   
        }   
       
        // 在服务端启动一个 socket 监听   
        private async void btnStartListener_Click(object sender, RoutedEventArgs e)   
        {   
            // 实例化一个 socket 监听对象   
            _listener = ne StreamSocketListener();   
            // 监听在接收到一个连接后所触发的事件   
            _listener.ConnectionReceived += _listener_ConnectionReceived;   
  
       
            try
            {   
                // 在指定的端口上启动 socket 监听   
                aait _listener.BindServiceNameAsync("2211");   
       
                lblMsg.Text += "已经在本机的 2211 端口启动了 socket(tcp) 监听";   
                lblMsg.Text += Environment.NeLine;   
       
            }   
            catch (Exception ex)   
            {   
                SocketErrorStatus errStatus = SocketError.GetStatus(ex.HResult);   
       
                lblMsg.Text += "errStatus: " + errStatus.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += ex.ToString();   
                lblMsg.Text += Environment.NeLine;   
            }   
www.pf025.net/zlzx/zl/946.html?1400923485
www.pf025.net/zlzx/zl/947.html?1400923483
    {   
            NavigationService.Navigate(ne Uri("/CameraAndPhoto/AudioVideoCaptureDeviceDemo.xaml", UriKind.Relative));   
        }   
    }   
}

www.pf025.net/zlzx/zl/948.html?1400923481
www.pf025.net/zlzx/zl/949.html?1400923479
  
        // socket 监听接收到一个连接后   
        async void _listener_ConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)   
        {   
            // 实例化一个 DataReader,用于读取数据   
            DataReader reader = ne DataReader(args.Socket.InputStream);   
       
            this.Dispatcher.BeginInvoke(delegate()   
            {   
                lblMsg.Text += "服务端收到了来自: " + args.Socket.Information.RemoteHostName.RaName + ":" + args.Socket.Information.RemotePort + " 的 socket 连接";   
                lblMsg.Text += Environment.NeLine;   
            });   
       
            try
            {   
                hile (true)   
                {   
                    // 自定义协议(header|body):前4个字节代表实际数据的长度,之后的实际数据为一个字符串数据   
       
                    // 读取 header   
                    uint sizeFieldCount = aait reader.LoadAsync(sizeof(uint));   
                    if (sizeFieldCount != sizeof(uint))   
                    {   
                        // 在获取到合法数据之前,socket 关闭了   
                        return;   
                    }   
       
                    // 读取 body   
                    uint stringLength = reader.ReadUInt32();   
                    uint actualStringLength = aait reader.LoadAsync(stringLength);   
                    if (stringLength != actualStringLength)   
                    {   
                        // 在获取到合法数据之前,socket 关闭了   
                        return;   
                    }   
       
                    this.Dispatcher.BeginInvoke(delegate()   
                    {   
                        // 显示客户端发送过来的数据   
                        lblMsg.Text += "接收到数据: " + reader.ReadString(actualStringLength);   
                        lblMsg.Text += Environment.NeLine;   
                    });   
                }   
blog.sina.com.cn/s/blog_b9d4c9220101kuqz.html
blog.sina.com.cn/s/blog_b9d4c9220101kur2.html
    {   
            IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;   
       
            if (queryStrings.ContainsKey("fromLens"))   
            {   
                lblMsg.Text = "您是通过相机的“滤镜”启动本 app 的";   
            }   
       
            base.OnNavigatedTo(e);   
        }   
       
        private void btnPhotoCapture_Click(object sender, System.indos.RoutedEventArgs e)

{   
            NavigationService.Navigate(ne Uri("/CameraAndPhoto/PhotoCaptureDeviceDemo.xaml", UriKind.Relative));   
        }   
       
        private void btnAudioVideoCapture_Click(object sender, System.indos.RoutedEventArgs e)   
blog.sina.com.cn/s/blog_b9d4c9220101kur5.html
user.qzone.qq.com/1970001032/blog/1401122277
    catch (Exception ex)   
            {   
                this.Dispatcher.BeginInvoke(delegate()   
                {   
                    SocketErrorStatus errStatus = SocketError.GetStatus(ex.HResult);   
       
                    lblMsg.Text += "errStatus: " + errStatus.ToString();   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text += ex.ToString();   
                    lblMsg.Text += Environment.NeLine;   
                });   
            }   
        }   
       
        // 创建一个客户端 socket,并连接到服务端 socket   
        private async void btnConnectListener_Click(object sender, RoutedEventArgs e)   
        {   
            HostName hostName;   
            try
            {   
                hostName = ne HostName("127.0.0.1");   
            }   
            catch (Exception ex)   
            {   
                lblMsg.Text += ex.ToString();   
                lblMsg.Text += Environment.NeLine;   
       
                return;   
            }   
user.qzone.qq.com/1970001032/blog/1401122241
user.qzone.qq.com/1970001032/blog/1401122212
user.qzone.qq.com/1970001032/blog/1401122179
       _client = ne StreamSocket();   
       
            try
            {   
                // 连接到指定的服务端 socket   
                aait _client.ConnectAsync(hostName, "2211");   
       
                lblMsg.Text += "已经连接上了 127.0.0.1:2211";   
                lblMsg.Text += Environment.NeLine;   
            }   
            catch (Exception ex)   
            {   
                SocketErrorStatus errStatus = SocketError.GetStatus(ex.HResult);   
       
                lblMsg.Text += "errStatus: " + errStatus.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += ex.ToString();   
                lblMsg.Text += Environment.NeLine;   
            }   
        }   
       
        // 从客户端 socket 发送一个字符串数据到服务端 socket   
        private async void btnSendData_Click(object sender, RoutedEventArgs e)   
        {   
            // 实例化一个 Datariter,用于发送数据   
            if (_riter == null)   
                _riter = ne Datariter(_client.OutputStream);   
       
            // 自定义协议(header|body):前4个字节代表实际数据的长度,之后的实际数据为一个字符串数据   
       
            string data = "hello ebabcd " + DateTime.No.ToString("hh:mm:ss");   
            _riter.riteUInt32(_riter.MeasureString(data)); // 写 header 数据   
            _riter.riteString(data); // 写 body 数据   
       
            try
            {   
                // 发送数据   
user.qzone.qq.com/1970001032/blog/1401122117
user.qzone.qq.com/1970001032/blog/1401125888
user.qzone.qq.com/1970001032/blog/1401125862
             aait _riter.StoreAsync();   
       
                lblMsg.Text += "数据已发送: " + data;   
                lblMsg.Text += Environment.NeLine;   
            }   
            catch (Exception ex)   
            {   
                SocketErrorStatus errStatus = SocketError.GetStatus(ex.HResult);   
       
                lblMsg.Text += "errStatus: " + errStatus.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += ex.ToString();   
                lblMsg.Text += Environment.NeLine;   
            }   
        }   
       
        // 关闭客户端 socket 和服务端 socket   
        private void btnCloseSocket_Click(object sender, RoutedEventArgs e)   
        {   
            try
            {   
                _riter.DetachStream(); // 分离 Datariter 与 Stream 的关联   
                _riter.Dispose();   
       
                _client.Dispose();   
                _listener.Dispose();   
       
                lblMsg.Text += "服务端 socket 和客户端 socket 都关闭了";   
                lblMsg.Text += Environment.NeLine;   
            }   
            catch (Exception ex)   
            {   
                lblMsg.Text += ex.ToString();   
                lblMsg.Text += Environment.NeLine;   
            }   
        }   
    }   
}
user.qzone.qq.com/1970001032/blog/1401125833
user.qzone.qq.com/1970001032/blog/1401125808
user.qzone.qq.com/1970001032/blog/1401125780
2、演示如何获取当前连接的信息
Communication/ConnectionProfileDemo.xaml.cs
/*   
 * 演示如何获取当前连接的信息   
 *    
 *    
 * 注:   
 * 关于数据成本的判断参见:msdn.microsoft.com/zh-

cn/library/indosphone/develop/jj207005   
 */
       
using System;   
using System.indos.Navigation;   
using Microsoft.Phone.Controls;   
using indos.Netorking.Connectivity;   
       
namespace Demo.Communication   
{   
    public partial class ConnectionProfileDemo : PhoneApplicationPage   
    {   
        public ConnectionProfileDemo()   
        {   
            InitializeComponent();   
        }   
       
        protected override void OnNavigatedTo(NavigationEventArgs e)   
        {   
            // 获取当前的 Internet 连接信息   
            ConnectionProfile connectionProfile = NetorkInformation.GetInternetConnectionProfile();   
       
user.qzone.qq.com/1970001032/blog/1401125747
user.qzone.qq.com/1970001032/blog/1401125716
user.qzone.qq.com/1970001032/blog/1401125687
        * 获取由 IANA(Internet Assigned Names Authority - Internet 编号分配管理机构) 定义的接口类型   
             *     1 - 其他类型的网络接口   
             *     6 - 以太网网络接口   
             *     9 - 标记环网络接口   
             *     23 - PPP 网络接口   
             *     24 - 软件环回网络接口   
             *     37 - ATM 网络接口   
             *     71 - IEEE 802.11 无线网络接口   
             *     131 - 隧道类型封装网络接口   
             *     144 - IEEE 1394 (Fireire) 高性能串行总线网络接口   
             */
            uint ianaInterfaceType = connectionProfile.NetorkAdapter.IanaInterfaceType;   
            lblMsg.Text = "接口类型: " + ianaInterfaceType;   
            lblMsg.Text += Environment.NeLine;   
       
            ConnectionCost connectionCost = connectionProfile.GetConnectionCost();   
       
            // 网络成本的类型: Unknon, Unrestricted(无限制), Fixed, Variable   
            NetorkCostType netorkCostType = connectionCost.NetorkCostType;   
            lblMsg.Text += "网络成本的类型: " + netorkCostType.ToString();   
            lblMsg.Text += Environment.NeLine;   
       
            lblMsg.Text += "是否接近了数据限制的阈值: " + connectionCost.ApproachingDataLimit;   
            lblMsg.Text += Environment.NeLine;   
            lblMsg.Text += "是否超过了数据限制的阈值: " + connectionCost.OverDataLimit;   
            lblMsg.Text += Environment.NeLine;   
            lblMsg.Text += "是否处于漫游网络(即本地提供商以外的网络): " + connectionCost.Roaming;   
                   
            base.OnNavigatedTo(e);   
        }   
    }   
}
user.qzone.qq.com/1970001032/blog/1401125616
user.qzone.qq.com/1970001032/blog/1401125575
user.qzone.qq.com/1970001032/blog/1401125547
<phone:PhoneApplicationPage   
    x:Class="Demo.Communication.Other"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
user.qzone.qq.com/1970001032/blog/1401125434
user.qzone.qq.com/1970001032/blog/1401125393
user.qzone.qq.com/1970001032/blog/1401125360
<Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <TextBlock Name="lblMsg" Textrapping="rap">   
                <Run>1、序列化, , rss, socket 参见之前写的 in8 相关的文章即可</Run>   
                <LineBreak />   
                <Run>2、OData:参见:msdn.microsoft.com/zh-cn/library/indosphone/develop/gg521146</Run>   
                <LineBreak />   
                <Run>3、蓝牙:参见:msdn.microsoft.com/zh-cn/library/indosphone/develop/jj207007</Run>   
                <LineBreak />   
                <Run>4、NFC:参见:msdn.microsoft.com/zh-cn/library/indosphone/develop/jj207060</Run>   
                <LineBreak />   
                <Run>5、VoIP:参见:msdn.microsoft.com/zh-cn/library/indosphone/develop/jj206983, msdn.microsoft.com/zh-cn/library/indosphone/develop/jj207046, msdn.microsoft.com/zh-cn/library/indosphone/develop/jj553780</Run>   
                <LineBreak />   
                <Run>6、支持 insock API(socket 的本地 api),关于 p8 支持的 in32 API 参见:msdn.microsoft.com/zh-cn/library/indosphone/develop/jj662956</Run>

user.qzone.qq.com/1970001032/blog/1401125333
user.qzone.qq.com/1970001032/blog/1401125301
 *    
 *    
 * 注:   
 * 相关的 UriMapper 参见 MyUriMapper.cs   
 *    
 *    
 * 什么是镜头扩展?   
 * 就是打开相机后,单击“滤镜”按钮,会出现一排 app 列表,这里的每一个 app 就是一个镜头扩展程序   
 */
       
using System.Collections.Generic;   
using System.indos.Navigation;   
using Microsoft.Phone.Controls;   
using System;   
       
namespace Demo.CameraAndPhoto   
{   
    public partial class LensExtensibility : PhoneApplicationPage   
    {   
        public LensExtensibility()   
        {   
            InitializeComponent();   
        }   
user.qzone.qq.com/1970001032/blog/1401125273
user.qzone.qq.com/1970001032/blog/1401125238
     <LineBreak />   
            </TextBlock>   
       
        </StackPanel>   
    </Grid>   
       
</phone:PhoneApplicationPage>
OK
user.qzone.qq.com/1970001032/blog/1401125195
user.qzone.qq.com/1970001032/blog/1401125145
enda.so.com/q/1401152913504004
enda.so.com/q/1401152913504004
介绍
与众不同 indos phone 8.0 之 语音
TTS(Text To Speech)
语音识别
语音命令
示例
1、演示 TTS(Text To Speech)的应用
Speech/TTS.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.Speech.TTS"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
enda.so.com/q/1401153053505728
enda.so.com/q/1401153106506388
enda.so.com/q/1401153200507674
 <StackPanel Orientation="Vertical">   
       
            <TextBlock Name="lblMsg" />   
                   
            <Button x:Name="btnTTS_Basic" Content="TTS 基础" Click="btnTTS_Basic_Click" />   
       
            <Button x:Name="btnTTS_Select" Content="用指定的语音 TTS" Click="btnTTS_Select_Click" />   
       
            <Button x:Name="btnTTS_SSML" Content="朗读 SSML 文档" Click="btnTTS_SSML_Click" />   
       
        </StackPanel>   
    </Grid>   
       
</phone:PhoneApplicationPage>
enda.so.com/q/1401153261508518
enda.so.com/q/1401153316509112
enda.so.com/q/1401153408502578
  
 * 演示 TTS(Text To Speech)的应用   
 *    
 *    
 * InstalledVoices - 管理已安装的语音   
 *     All - 已安装的全部语音,返回 VoiceInformation 对象列表   
 *     Default - 默认语音,返回 VoiceInformation 对象   
 *        
 * VoiceInformation - 语音信息   
 *     Id - 标识   
 *     Language - 语言   
 *     DisplayName - 名称   
 *     Description - 描述   
 *     Gender - 性别(VoiceGender.Male 或 VoiceGender.Female)   
 *    
 * SpeechSynthesizer - TTS 的类   
 *     SetVoice(VoiceInformation voiceInformation) - 设置语音   
enda.so.com/q/1401153549500818
enda.so.com/q/1401153659508624
enda.so.com/q/1401153724503192
enda.so.com/q/1401153814504982
 *     SpeakTextAsync(string content, object userState) - 朗读指定的文本。可以设置一个上下文对象,在 SpeechStarted 时取出   
 *     SpeakSsmlAsync(string content, object userState) - 朗读指定的 SSML 文档。可以设置一个上下文对象,在 SpeechStarted 时取出   
 *     SpeakSsmlFromUriAsync(Uri content, object userState) - 朗读指定地址的 SSML 文档。可以设置一个上下文对象,在 SpeechStarted 时取出   
 *     CancelAll() - 取消全部朗读   
 *     SpeechStarted - 开始朗读时触发的事件   
 *     BookmarkReached - 朗读到 <mark /> 标记时触发的事件(仅针对 SSML 协议)   
 *    
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_SPEECH_RECOGNITION" />   
 * 2、SSML - Speech Synthesis Markup Language   
 * 3、微软关于 ssml 的说明:msdn.microsoft.com/en-us/library/hh361578   
 * 4、3C 关于 ssml 的说明:.3.org/TR/speech-synthesis/   
 */
       
enda.so.com/q/1401154249500010
enda.so.com/q/1401154344501122
enda.so.com/q/1401154440502220
using System;   
using System.Collections.Generic;   
using System.Linq;   
using System.indos;   
using Microsoft.Phone.Controls;   
using indos.Phone.Speech.Synthesis;   
       
namespace Demo.Speech   
{   
    public partial class TTS : PhoneApplicationPage   
    {   
        private string _text = "TTS 是 Text To Speech 的缩写<mark name=\"xxx\" />,即“从文本到语音”,是人机对话的一部分,让机器能够说话。";   
       
        public TTS()   
        {   
            InitializeComponent();   
        }   
       
        // 默认方式朗读文本   
        private async void btnTTS_Basic_Click(object sender, RoutedEventArgs e)   
        {   
            SpeechSynthesizer speechSynthesizer = ne SpeechSynthesizer();   
            aait speechSynthesizer.SpeakTextAsync(_text);   
        }   
       
        // 用指定的语音朗读文本   
        private async void btnTTS_Select_Click(object sender, RoutedEventArgs e)   
        {   
            SpeechSynthesizer speechSynthesizer = ne SpeechSynthesizer();   
blog.sina.com.cn/s/blog_be8b15840101hga.html
blog.sina.com.cn/s/blog_be8b33b80101qnk.html
blog.sina.com.cn/s/blog_b077e6ca0101iix2.html
    // 中文语音列表(应该有两条记录:第一条是女声;第二条是男声。具体信息可从 VoiceInformation 对象中获取)   
            IEnumerable<VoiceInformation> zhVoices = from voice in InstalledVoices.All   
                                                     here voice.Language == "zh-CN"
                                                     select voice;   
       
            // 设置语音   
            speechSynthesizer.SetVoice(zhVoices.ElementAt(0));   
       
            // 朗读文本   
            aait speechSynthesizer.SpeakTextAsync(_text);   
        }   
       
        // 朗读指定 SSML 协议文档   
        private async void btnTTS_SSML_Click(object sender, RoutedEventArgs e)   
        {   
            SpeechSynthesizer speechSynthesizer = ne SpeechSynthesizer();   
       
            // 开始朗读时触发的事件   
            speechSynthesizer.SpeechStarted += speechSynthesizer_SpeechStarted;   
       
            // 到达 <mark /> 标记时触发的事件   
            speechSynthesizer.BookmarkReached += speechSynthesizer_BookmarkReached;   
       
            // 微软关于 ssml 的说明:msdn.microsoft.com/en-us/library/hh361578   
            // 3C 关于 ssml 的说明:.3.org/TR/speech-synthesis/   
       
            string ssml = "<speak version=\"1.0\" xmlns=\".3.org/2001/10/synthesis\" xml:lang=\"zh-CN\">"; // 中文   
            ssml += "<voice gender=\"male\">"; // 男声   
            ssml += "<prosody rate=\"-50%\">"; // 语速放慢 50%   
blog.sina.com.cn/s/blog_be8b33b80101qnm.html
blog.sina.com.cn/s/blog_be8b33b80101qnp.html
        </StackPanel>   
    </Grid>   
       
</phone:PhoneApplicationPage>
CameraAndPhoto/LensExtensibility.xaml.cs
/*   
 * 演示如何将本 app 注册为镜头扩展   
 *    
 * 1、需要在 manifest 中增加配置 <Extension TaskID="_default"

ExtensionName="Camera_Capture_App" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5631}" />   
 * 2、在 Assets 根文件夹内添加 3 个文件,作为镜头选取器的图标   
 *    Lens.Screen-VGA.png - 800*480  15:9   
 *    Lens.Screen-XGA.png - 1280*768 15:9   
 *    Lens.Screen-720p.png - 1280*720 16:9   
blog.sina.com.cn/s/blog_b077e6ca0101iix4.html
blog.sina.com.cn/s/blog_be8b33b80101qnr.html
     ssml += _text;   
            ssml += "</prosody>";   
            ssml += "</voice>";   
            ssml += "</speak>";   
                 
            // 朗读 SSML   
            aait speechSynthesizer.SpeakSsmlAsync(ssml);   
        }   
       
        void speechSynthesizer_SpeechStarted(SpeechSynthesizer sender, SpeechStartedEventArgs args)   
        {   
            // 获取上下文对象   
            object userState = args.UserState;   
        }   
       
        void speechSynthesizer_BookmarkReached(SpeechSynthesizer sender, SpeechBookmarkReachedEventArgs args)   
        {   
            this.Dispatcher.BeginInvoke(delegate()    
            {   
                // 触发当前事件的 <mark /> 标记的名称   
                lblMsg.Text = "mark name: " + args.Bookmark;   
                lblMsg.Text += Environment.NeLine;   
       
                // 朗读到触发当前事件的 <mark /> 标记所用的时间   
                lblMsg.Text += "audio position: " + args.AudioPosition.TotalSeconds;   
            });   
        }   
    }   
}
blog.sina.com.cn/s/blog_be8b33b80101qnt.html
blog.sina.com.cn/s/blog_b077e6ca0101iix6.html
blog.sina.com.cn/s/blog_be8b33b80101qnu.html
2、演示如何通过自定义语法列表做语音识别,以及如何通过 SRGS 自定义语法做语音识别
Speech/SRGSGrammar.xml
<?xml version="1.0" encoding="utf-8"?>   
<grammar version="1.0" xml:lang="zh-cn" root="Main" tag-format="semantics/1.0"
         xmlns=".3.org/2001/06/grammar"
         xmlns:sapi="schemas.microsoft.com/Speech/2002/06/SRGSExtensions">   
  <rule id="Main">   
    <item repeat="0-1">我想去</item>   
    <ruleref uri="#Cities" />   
  </rule>   
  <rule id="Cities" scope="public">   
    <one-of>   
www.h-eq.com/qb/1669.html
www.h-eq.com/qb/1670.html
www.h-eq.com/qb/1671.html
    <item>北京</item>   
      <item>深圳</item>   
      <item>上海</item>   
      <item>广州</item>   
    </one-of>   
  </rule>   
</grammar>   
       
<!--   
本例可以识别:我想去北京;我想去深圳;我想去上海;我想去广州;北京;深圳;上海;广州   
       
Visual Studio 有创建 SRGSGrammar(SRGS 语法)文件的模板   
微软关于 SRGS 的说明:msdn.microsoft.com/en-us/library/hh361653   
3C 关于 SRGS 的说明:.3.org/TR/speech-grammar/   
-->
www.h-eq.com/qb/1672.html
www.h-eq.com/qb/1673.html
www.h-eq.com/qb/1674.html
Speech/SpeechRecognition.xaml
<phone:PhoneApplicationPage
    x:Class="Demo.Speech.SpeechRecognition"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait
www.h-eq.com/qb/1675.html
www.h-eq.com/qb/1676.html
www.h-eq.com/qb/1677.html
www.pf025.net/zlzx/by/950.html?1401005212
 mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <TextBlock Name="lblMsg" />   
       
            <Button x:Name="btnDemo" Content="通过自定义语法列表做语音识别" Click="btnDemo_Click" />   
       
            <Button x:Name="btnSRGS" Content="通过 SRGS 自定义语法做语音识别" Click="btnSRGS_Click" />   
                   
        </StackPanel>   
    </Grid>   
       
</phone:PhoneApplicationPage>
www.pf025.net/zlzx/by/951.html?1401005208
www.pf025.net/zlzx/by/952.html?1401005205
www.pf025.net/zlzx/by/953.html?1401005203
*   
 * 演示如何通过自定义语法列表做语音识别,以及如何通过 SRGS 自定义语法做语音识别   
 *    
 *    
 * 语音识别:用于在 app 内识别语音   
 * 语音命令:用于在 app 外通过语音命令启动 app   
 *     
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_SPEECH_RECOGNITION" />

<Capability Name="ID_CAP_MICROPHONE" />   
 * 2、安装语音识别器:设置 -> 语音 -> 在“语音语言”列表中安装指定的语音识别器,并启

用语音识别服务   
 * 3、SRGS - Speech Recognition Grammar Specification   
 * 4、微软关于 SRGS 的说明:msdn.microsoft.com/en-us/library/hh361653   
 * 5、3C 关于 SRGS 的说明:.3.org/TR/speech-grammar/   
 */
www.pf025.net/zlzx/by/954.html?1401005200
www.pf025.net/zlzx/by/955.html?1401005197
www.pf025.net/zlzx/by/956.html?1401005194
using System;   
using System.Collections.Generic;   
using System.Linq;   
using System.indos;   
using Microsoft.Phone.Controls;   
using indos.Phone.Speech.Recognition;   
       
namespace Demo.Speech   
{   
    public partial class SpeechRecognition : PhoneApplicationPage   
    {   
        public SpeechRecognition()   
        {   
            InitializeComponent();   
        }   
       
        private async void btnDemo_Click(object sender, RoutedEventArgs e)   
        {   
            // 语音识别器,带 UI 的   
            SpeechRecognizerUI speechRecognizerUI = ne SpeechRecognizerUI();   
       
  
www.pf025.net/zlzx/by/957.html?1401005191
www.pf025.net/zlzx/by/958.html?1401005189
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <TextBlock x:Name="lblMsg" Text="启动相机后,可以通过“滤镜”启动本 app" />   
       
            <Button x:Name="btnPhotoCapture" Content="用此 app 照相" Click="btnPhotoCapture_Click" />   
       
            <Button x:Name="btnAudioVideoCapture" Content="用此 app 录像" Click="btnAudioVideoCapture_Click" />   
       
www.pf025.net/zlzx/by/959.html?1401005187
      // 识别过程中发生问题时触发的事件   
            speechRecognizerUI.Recognizer.AudioProblemOccurred += Recognizer_AudioProblemOccurred;   
            // 音频捕获状态发生变化时触发的事件   
            speechRecognizerUI.Recognizer.AudioCaptureStateChanged += Recognizer_AudioCaptureStateChanged;   
       
            // InitialSilenceTimeout - 在此时间内收到的都是无声输入,则终止识别   
            speechRecognizerUI.Recognizer.Settings.InitialSilenceTimeout = TimeSpan.FromSeconds(5.0);   
            // EndSilenceTimeout - 语音识别开始后,如果此时间内都是无声输入,则识别结束   
            speechRecognizerUI.Recognizer.Settings.EndSilenceTimeout = TimeSpan.FromSeconds(0.15);   
            // BabbleTimeout - 在此时间内收到的都是噪音,则终止识别(0 代表禁用此功能)   
            speechRecognizerUI.Recognizer.Settings.BabbleTimeout = TimeSpan.FromSeconds(0.0);   
       
            // 获取中文语音识别器   
            IEnumerable<SpeechRecognizerInformation> zhRecognizers = from recognizerInfo in InstalledSpeechRecognizers.All   
                                                                     here recognizerInfo.Language == "zh-CN"
                                                                     select recognizerInfo; 
www.pf025.com/bzdh/pffsqjb/jzb/1603.html?1401005440
www.pf025.com/bzdh/pffsqjb/jzb/1614.html?1401005408
www.pf025.com/bzdh/pffsqjb/jzb/1604.html?1401005437
   if (zhRecognizers.Count() > 0)   
            {   
                // 指定语音识别器   
                speechRecognizerUI.Recognizer.SetRecognizer(zhRecognizers.First());   
       
                // 设置语音识别的单词列表   
                string[] phrases = { "xbox", "海贼王", "王磊" };   
                speechRecognizerUI.Recognizer.Grammars.AddGrammarFromList("myord", phrases);   
                // speechRecognizerUI.Recognizer.Grammars.AddGrammarFromPredefinedType("dictation", SpeechPredefinedGrammar.Dictation); // 听写整句,基于本地的语音识别   
                // speechRecognizerUI.Recognizer.Grammars.AddGrammarFromPredefinedType("ebSearch", SpeechPredefinedGrammar.ebSearch); // 听写整句,基于网络的语音识别   
       
                // 预加载全部语法   
                aait speechRecognizerUI.Recognizer.PreloadGrammarsAsync();   
       
                // 带 UI 的语音识别器的监听页上显示的标题   
                speechRecognizerUI.Settings.ListenText = "监听中。。。";   
       
www.pf025.com/bzdh/pffsqjb/jzb/1605.html?1401005432
www.pf025.com/bzdh/pffsqjb/jzb/1606.html?1401005430
www.pf025.com/bzdh/pffsqjb/jzb/1607.html?1401005426
        // 带 UI 的语音识别器的监听页上显示的示例文本   
                speechRecognizerUI.Settings.ExampleText = "精确识别:xbox, 海贼王, 王磊";   
       
                // 在“您说的是”页(如果匹配到多条记录,则会在此页列出)和“听到您说”页是否需要通过 TTS 朗读识别的内容(当在语音设置中启用了“播放音频确认”时,此处 true 才会有效)

speechRecognizerUI.Settings.ReadoutEnabled = true;   
       
                // 是否显示“听到您说”页(用于显示识别出的最终文本)   
                speechRecognizerUI.Settings.ShoConfirmation = false;   
       
                try
                {   
                    // 开始识别   
                    SpeechRecognitionUIResult result = aait speechRecognizerUI.RecognizeithUIAsync();   
www.pf025.com/bzdh/pffsqjb/jzb/1608.html?1401005423
www.pf025.com/bzdh/pffsqjb/jzb/1609.html?1401005420
www.pf025.com/bzdh/pffsqjb/jzb/1610.html?1401005418
            lblMsg.Text = "识别状态: " + result.ResultStatus.ToString();   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text += "识别结果:" + result.RecognitionResult.Text;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text += "可信度级别: " + result.RecognitionResult.TextConfidence.ToString(); // Rejected, Lo, Medium, High   
                }   
                catch (Exception ex)   
                {   
                    if ((uint)ex.HResult == 0x800455BC)   
                    {   
                        lblMsg.Text = "当前语音识别器不支持所请求的语言: " + speechRecognizerUI.Recognizer.GetRecognizer().Language;   
                    }   
                    else
                    {   
                        lblMsg.Text = ex.ToString();   
                    }   
                }   
            }   
            else
            {   
                lblMsg.Text = "未安装中文语音识别器";   
            }   
        }   
       
        void Recognizer_AudioCaptureState
www.pf025.com/bzdh/pffsqjb/jzb/1611.html?1401005415
www.pf025.com/bzdh/pffsqjb/jzb/1612.html?1401005413
www.pf025.com/bzdh/pffsqjb/jzb/1613.html?1401005411
user.qzone.qq.com/1970001032/blog/1401123329
Changed(SpeechRecognizer sender, SpeechRecognizerAudioCaptureStateChangedEventArgs args)   
        {   
            // 音频捕获状态发生了变化:Capturing(捕获中) 或 Inactive(未捕获)   
            lblMsg.Text = "AudioCaptureStateChanged: " + args.State.ToString();   
        }   
       
        void Recognizer_AudioProblemOccurred(SpeechRecognizer sender, SpeechAudioProblemOccurredEventArgs args)   
        {   
            // 识别过程中发生了问题:TooLoud, TooQuiet, TooFast, TooSlo, TooNoisy, NoSignal, None   
            lblMsg.Text = "AudioProblemOccurred: " + args.Problem.ToString();   
        }   
       
       
       
        // 通过 SRGS 自定义语法   
        // 微软关于 SRGS 的说明:msdn.microsoft.com/en-us/library/hh361653   
        // 3C 关于 SRGS 的说明:.3.org/TR/speech-grammar/   
        private async void btnSRGS_Click(object sender, RoutedEventArgs e)   
        {   
            // 语音识别器,无 UI 的   
            SpeechRecognizer speechRecognizer = ne SpeechRecognizer();   
       
            // 指定 SRGS 语法   
            Uri mySRGS = ne Uri("ms-appx/Speech/SRGSGrammar.xml", UriKind.Absolute);   
            speechRecognizer.Grammars.AddGrammarFromUri("srgs", mySRGS);   
       
            try
            {   
                lblMsg.Text = "监听中。。。";   
                lblMsg.Text += Environment.NeLine;   
       
                // 开始识别   
                SpeechRecognitionResult result = aait speechRecognizer.RecognizeAsync();   
       
user.qzone.qq.com/1970001032/blog/1401123304
user.qzone.qq.com/1970001032/blog/1401123280
user.qzone.qq.com/1970001032/blog/1401123256
       lblMsg.Text += "识别结果:" + result.Text;   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "可信度级别: " + result.TextConfidence.ToString(); // Rejected, Lo, Medium, High   
            }   
            catch (Exception ex)   
            {   
                if ((uint)ex.HResult == 0x800455BC)   
                {   
                    lblMsg.Text = "当前语音识别器不支持所请求的语言: " + speechRecognizer.GetRecognizer().Language;   
                }   
                else
                {   
                    lblMsg.Text = ex.ToString();   
                }   
            }   
        }   
    }   
}
user.qzone.qq.com/1970001032/blog/1401123233
user.qzone.qq.com/1970001032/blog/1401123209
user.qzone.qq.com/1970001032/blog/1401123185
ml version="1.0" encoding="utf-8"?>   
<VoiceCommands xmlns="schemas.microsoft.com/voicecommands/1.0">   
  <CommandSet xml:lang="zh-cn">   
       
    <!--命令前缀,不指定此值的话则会使用程序名做命令前缀-->   
    <CommandPrefix>贪吃蛇</CommandPrefix>   
    <!--语音监听窗口会随机显示不同 app 的语音命令提示文字(贪吃蛇 开始),轮到此 app 的时候就可能会显示这个-->   
    <Example>开始</Example>   
       
    <Command Name="PlayGame">   
      <!--语音监听窗口会随机显示不同 app 的语音命令提示文字(贪吃蛇 开始),轮到此 app 的时候就可能会显示这个-->   
      <Example>开始</Example>   
      <!--监听语法-->   
      <ListenFor>[马上] 开始</ListenFor>   
      <!--监听语法-->   
      <ListenFor>[马上] 启动</ListenFor>   
      <!--准备启动目标 app 时,在监听窗口中显示的提示文字(当在语音设置中启用了“播放音频确认”时,此文字会作为 TTS 的文本)-->   
user.qzone.qq.com/1970001032/blog/1401123134
user.qzone.qq.com/1970001032/blog/1401123079
user.qzone.qq.com/1970001032/blog/1401123025
    <Feedback>准备启动</Feedback>   
      <!--启动页-->   
      <Navigate Target="/Speech/VoiceCommands.xaml" />   
    </Command>   
       
    <Command Name="PlayLevel">   
      <!--语音监听窗口会随机显示不同 app 的语音命令提示文字(贪吃蛇 从等级 2 开始),轮到此 app 的时候就可能会显示这个-->   
      <Example>从等级 2 开始</Example>   
      <!--监听语法-->   
      <ListenFor>从等级 {number} 开始</ListenFor>   
      <!--准备启动目标 app 时,在监听窗口中显示的提示文字(当在语音设置中启用了“播放音频确认”时,此文字会作为 TTS 的文本)-->   
      <Feedback>正转到等级 {number}... </Feedback>   
      <!--启动页-->   
      <Navigate Target="/Speech/VoiceCommands.xaml" />   
    </Command>   
       
    <!--ListenFor 和 Feedback 可以通过 {number} 来引用此集合-->   
    <PhraseList Label="number">   
      <Item>1</Item>   
      <Item>2</Item>   
      <Item>3</Item>   
    </PhraseList>   
       
user.qzone.qq.com/1970001032/blog/1401122988
user.qzone.qq.com/1970001032/blog/1401122955
user.qzone.qq.com/1970001032/blog/1401122897
  </CommandSet>   
</VoiceCommands>   
       
<!--   
本例可以识别:贪吃蛇开始,贪吃蛇马上开始,贪吃蛇启动,贪吃蛇马上启动,贪吃蛇从等级 1 开始,

从等级 2 开始,从等级 3 开始   
       
Visual Studio 有创建 VoiceCommandDefinition(语音命令定义)文件的模板   
关于 VoiceCommands 的详细说明参见:msdn.microsoft.com/en-us/library/indosphone/develop/jj207041   -->
Speech/VoiceCommands.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.Speech.VoiceCommands"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
user.qzone.qq.com/1970001032/blog/1401122861
user.qzone.qq.com/1970001032/blog/1401122818
8.0 相机和照片: 镜头的可扩展性, 图片的可扩展性, 图片的自动上传扩展
介绍
与众不同 indos phone 8.0 之 相机和照片
镜头的可扩展性
图片的可扩展性
图片的自动上传扩展
示例
1、演示如何将本 app 注册为镜头扩展
CameraAndPhoto/LensExtensibility.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.CameraAndPhoto.LensExtensibility"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
user.qzone.qq.com/1970001032/blog/1401122744
user.qzone.qq.com/1970001032/blog/1401122680
  FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <TextBlock Name="lblMsg" Textrapping="rap" Text="返回到开始屏幕,长按 indos 键,说出你的语音命令(语音命令的定义参见 VoiceCommandDefinition.xml)" />   
       
        </StackPanel>   
    </Grid>   
           
</phone:PhoneApplicationPage>
user.qzone.qq.com/1970001032/blog/1401122647
user.qzone.qq.com/1970001032/blog/1401122611
user.qzone.qq.com/1970001032/blog/1401122512
/*   
 * 演示如何通过语音命令启动 app,以及 app 启动后如何获取启动此 app 的语音命令的标识和内容   
 *    
 *    
 * 语音识别:用于在 app 内识别语音   
 * 语音命令:用于在 app 外通过语音命令启动 app   
 *    
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_SPEECH_RECOGNITION" />

<Capability Name="ID_CAP_MICROPHONE" />   
 * 2、关于 VoiceCommands 的详细说明参见:msdn.microsoft.com/en-us/library/indosphone/develop/jj207041   
 */
       
using System;   
using System.indos;   
using Microsoft.Phone.Controls;   
using indos.Phone.Speech.VoiceCommands;   
using System.indos.Navigation;   
       
user.qzone.qq.com/1970001032/blog/1401122482
user.qzone.qq.com/1970001032/blog/1401122444
user.qzone.qq.com/1970001032/blog/1401122407
namespace Demo.Speech   
{   
    public partial class VoiceCommands : PhoneApplicationPage   
    {   
        public VoiceCommands()   
        {   
            InitializeComponent();   
       
            this.Loaded += VoiceCommands_Loaded;   
        }   
       
        private async void VoiceCommands_Loaded(object sender, RoutedEventArgs e)   
        {   
            // 向系统注册本 app 的语音命令定义   
            aait VoiceCommandService.InstallCommandSetsFromFileAsync(ne Uri("ms-appx/Speech/VoiceCommandDefinition.xml"));   
       
            // 获取语音命令定义的 CommandSet 中的内容,可以动态修改   
            // VoiceCommandService.InstalledCommandSets   
        }   
       
        protected override void OnNavigatedTo(NavigationEventArgs e)   
user.qzone.qq.com/1970001032/blog/1401122346
user.qzone.qq.com/1970001032/blog/1401122320
     // 由图片扩展之“自动上传”启动本 app 时会通过 /MainPage.xaml?Action=ConfigurePhotosUploadSettings 启动   
            else if (tempUrl.Contains("Action=ConfigurePhotosUploadSettings"))   
            {   
                return ne Uri("/CameraAndPhoto/PhotoAutoUpload.xaml?fromConfig=true", UriKind.Relative);   
            }   
            // 在锁屏设置界面,如果将本 app 设置为背景提供程序,则锁屏界面上会有一个名为“打开应用”的按钮,点击后会通过 /MainPage.xaml?allpaperSettings=1 启动本 app   
            else if (tempUrl.Contains("allpaperSettings=1"))   
            {   
                return ne Uri("/Others/LockScreen.xaml?allpaperSettings=1", UriKind.Relative);   
            }   
       
            return uri;   
        }   
    }   
blog.sina.com.cn/s/blog_13120bf7c0101opja.html
blog.sina.com.cn/s/blog_13120bf7c0101opjc.html
blog.sina.com.cn/s/blog_13120bf7c0101opjd.html
          // 通过语音命令启动时,url 类似如下:/Speech/VoiceCommands.xaml?voiceCommandName=PlayGame&reco=%E8%B4%AA%E5%90%83%E8%9B%87%20%E5%BC%80%E5%A7%8B   
       
            if (NavigationContext.QueryString.ContainsKey("voiceCommandName"))   
            {   
                lblMsg.Text = "语音命令的标识: " + NavigationContext.QueryString["voiceCommandName"];   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "语音命令的内容: " + NavigationContext.QueryString["reco"];

}   
       
            base.OnNavigatedTo(e);   
        }   
    }   
}
blog.sina.com.cn/s/blog_b9cd56120101k11t.html
blog.sina.com.cn/s/blog_b9cd56120101k11v.html
blog.sina.com.cn/s/blog_b9cd56120101k11.html
介绍
与众不同 indos phone 8.0 之 位置和地图
位置(GPS) - Location API
诺基亚地图
示例
1、演示新 Location API 的应用
GPS/Demo.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.GPS.Demo"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
blog.sina.com.cn/s/blog_b9cd56120101k11z.html
blog.sina.com.cn/s/blog_b9cd56120101k122.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqa.html
   mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid x:Name="LayoutRoot">   
        <StackPanel>   
                   
            <TextBlock Name="lblMsg" Textrapping="rap" />   
                   
            <Button x:Name="btnDemo" Content="通过 GPS 获取当前位置" Click="btnDemo_Click" />   
                   
        </StackPanel>   
    </Grid>   
       
       
</phone:PhoneApplicationPage>
blog.sina.com.cn/s/blog_b9d4c9220101kuqb.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqc.html
xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} 启动   
            else if (tempUrl.Contains("Action=ShareContent"))   
            {   
                string fileId = tempUrl.Substring(tempUrl.IndexOf("FileId=") + 7).Replace("{", "").Replace("}", "");   
                return ne Uri("/CameraAndPhoto/PhotoExtensibility.xaml?type=share&token=" + fileId, UriKind.Relative);   
            }   
            // 由图片扩展之“编辑...”启动本 app 时会通过 /MainPage.xaml?Action=EditPhotoContent&FileId={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} 启动   
            else if (tempUrl.Contains("Action=EditPhotoContent"))   
            {   
                string fileId = tempUrl.Substring(tempUrl.IndexOf("FileId=") + 7).Replace("{", "").Replace("}", "");   
                return ne Uri("/CameraAndPhoto/PhotoExtensibility.xaml?type=edit&token=" + fileId, UriKind.Relative);   
blog.sina.com.cn/s/blog_b9d4c9220101kuqg.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqm.html
  
 * 演示新 Location API 的应用   
 *    
 * p7 时代的 Location API 也是支持的(能不用就别用了),参见:

.cnblogs.com/ebabcd/archive/2012/08/09/2629636.html   
 *    
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_LOCATION" />   
 * 2、在获取位置数据之前,需要提供隐私策略并得到用户的允许   
 * 3、目前 p 机器的位置提供程序都是 GPS   
 */
       
using System;   
using System.indos;   
blog.sina.com.cn/s/blog_b9d4c9220101kuqo.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqt.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqu.html
using indos.Devices.Geolocation;   
       
namespace Demo.GPS   
{   
    public partial class Demo : PhoneApplicationPage   
    {   
        // 新的 Location API   
        Geolocator geolocator;   
       
        public Demo()   
        {   
            InitializeComponent();   
        }   
       
        protected override void OnNavigatedTo(System.indos.Navigation.NavigationEventArgs e)   
        {   
            geolocator = ne Geolocator();   
       
            // 期望的精度级别(PositionAccuracy.Default 或 PositionAccuracy.High)   
            geolocator.DesiredAccuracy = PositionAccuracy.High;   
            // 期望的数据精度(米)   
            geolocator.DesiredAccuracyInMeters = 50;   
       
            // 移动距离超过此值后,触发 PositionChanged 事件   
            geolocator.MovementThreshold = 100;   
            // 在两次位置更新的时间点中间,请求位置数据的最小间隔(毫秒)   
blog.sina.com.cn/s/blog_b9d4c9220101kuq.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqz.html
blog.sina.com.cn/s/blog_b9d4c9220101kur2.html
    geolocator.ReportInterval = 0;   
       
            // 位置更新时触发的事件   
            geolocator.PositionChanged += geolocator_PositionChanged;   
            // 位置服务的状态发生改变时触发的事件   
            geolocator.StatusChanged += geolocator_StatusChanged;   
       
            base.OnNavigatedTo(e);   
        }   
       
        protected override void OnNavigatedFrom(System.indos.Navigation.NavigationEventArgs e)   
        {   
            geolocator.PositionChanged -= geolocator_PositionChanged;   
            geolocator.StatusChanged -= geolocator_StatusChanged;   
            geolocator = null;   
       
            base.OnNavigatedFrom(e);   
        }   
       
        private async void btnDemo_Click(object sender, RoutedEventArgs e)   
        {   
            try
            {   
                // 获取位置信息   
                Geoposition geoposition = aait geolocator.GetGeopositionAsync();   
       
                lblMsg.Text = "位置精度(米): " + geoposition.Coordinate.Accuracy.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "海拔精度(米): " + geoposition.Coordinate.AltitudeAccuracy.ToString();   
blog.sina.com.cn/s/blog_b9d4c9220101kur5.html
blog.sina.com.cn/s/blog_b9cd56120101k1d1.html
blog.sina.com.cn/s/blog_b9cd56120101k1d2.html
blog.sina.com.cn/s/blog_b9e5d1ec0101i5qr.html
      lblMsg.Text += "纬度: " + geoposition.Coordinate.Latitude.ToString("0.00");

lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "经度: " + geoposition.Coordinate.Longitude.ToString("0.00");   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "海拔(米): " + geoposition.Coordinate.Altitude.ToString();

lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "行进方向(相对于正北的度数): " + geoposition.Coordinate.Heading.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "行进速度(米/秒): " + geoposition.Coordinate.Speed.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "确定位置的时间(UTC0): " + geoposition.Coordinate.Timestamp.ToString("yyyy-MM-dd hh:mm:ss");   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "数据源(Satellite, iFi, Cellular): " + geoposition.Coordinate.PositionSource.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "卫星的位置精度衰减: " + geoposition.Coordinate.SatelliteData.PositionDilutionOfPrecision.ToString();   
blog.sina.com.cn/s/blog_ba24b8400101k168.html
blog.sina.com.cn/s/blog_b9e5d1ec0101i5qt.html
blog.sina.com.cn/s/blog_ba2537100101ddiv.html
             lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "卫星的水平精度衰减: " + geoposition.Coordinate.SatelliteData.HorizontalDilutionOfPrecision.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "卫星的垂直精度衰减: " + geoposition.Coordinate.SatelliteData.VerticalDilutionOfPrecision.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += Environment.NeLine;   
       
                if (geoposition.CivicAddress != null)   
                {   
                    lblMsg.Text = "国家名称: " + geoposition.CivicAddress.Country;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "省名称: " + geoposition.CivicAddress.State;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "城市名称: " + geoposition.CivicAddress.City;   
blog.sina.com.cn/s/blog_ba2537100101ddi.html
blog.sina.com.cn/s/blog_ba2537100101ddix.html
blog.sina.com.cn/s/blog_be8b33b80101qnvt.html
blog.sina.com.cn/s/blog_be8b33b80101qnvu.html
        lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "邮编: " + geoposition.CivicAddress.PostalCode;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "确定位置的时间(UTC0): " + geoposition.CivicAddress.Timestamp;   
                }   
            }   
            catch (Exception ex)   
            {   
                if ((uint)ex.HResult == 0x80004004)   
                {   
                    lblMsg.Text = "定位服务当前是关闭状态,请打开它";   
                }   
                else
                {   
                    lblMsg.Text = ex.ToString();   
                }   
            }   
        }   
       
        // 位置服务的状态变化了   
        void geolocator_StatusChanged(Geolocator sender, StatusChangedEventArgs args)   
        {   
blog.sina.com.cn/s/blog_be8b33b80101qnvv.html
blog.sina.com.cn/s/blog_be8b33b80101qnv.html
         // 获取协议的详细信息   
                int protocolIndex = tempUrl.IndexOf("encodedLaunchUri=") + 17;   
                string protocol = tempUrl.Substring(protocolIndex);   
       
                // 导航到处理 ebabcd 协议的处理页面   
                return ne Uri("/AssociationLaunching/ProtocolAssociation.xaml?protocol=" + protocol, UriKind.Relative);   
            }   
            // 由镜头扩展启动本 app 时会通过 /MainPage.xaml?Action=ViefinderLaunch 启动   
            else if (tempUrl.Contains("Action=ViefinderLaunch"))   
            {   
                return ne Uri("/CameraAndPhoto/LensExtensibility.xaml?fromLens=true", UriKind.Relative);   
            }   
            // 由图片扩展之“共享...”启动
blog.sina.com.cn/s/blog_be8b33b80101qnvx.html
blog.sina.com.cn/s/blog_be8b33b80101qnvy.html
     // 获取位置服务的状态   
            PositionStatus status = geolocator.LocationStatus;   
       
            // 获取位置服务的状态   
            status = args.Status;   
       
            sitch (args.Status)   
            {   
                case PositionStatus.Disabled: // 位置提供程序已禁用,即用户尚未授予应用程序访问位置的权限   
                    break;   
                case PositionStatus.Initializing: // 初始化中   
                    break;   
                case PositionStatus.NoData: // 无有效数据   
                    break;   
                case PositionStatus.Ready: // 已经准备好了相关数据   
                    break;   
                case PositionStatus.NotAvailable: // 位置服务传感器不可用   
                    break;   
                case PositionStatus.NotInitialized: // 尚未初始化   
                    break;   
            }   
        }   
       
blog.sina.com.cn/s/blog_be8b33b80101qnvz.html
blog.sina.com.cn/s/blog_be8b15840101hg8.html
blog.sina.com.cn/s/blog_be8b15840101hg9.html
blog.sina.com.cn/s/blog_b077e6ca0101iiv.html
   // 位置变化了   
        void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)   
        {   
            this.Dispatcher.BeginInvoke(delegate()   
            {   
                Geoposition geoposition = args.Position;   
       
                lblMsg.Text = "纬度: " + geoposition.Coordinate.Latitude.ToString("0.00");

lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "经度: " + geoposition.Coordinate.Longitude.ToString("0.00");   
            });   
        }   
    }   
}
blog.sina.com.cn/s/blog_b077e6ca0101ii.html
blog.sina.com.cn/s/blog_b07ac5fe0101ji7p.html
     // 获取相关的文件名的扩展名   
                string fileType = Path.GetExtension(fileName);   
       
                // 根据文件类型的不同导航到不同的处理页面   
                sitch (fileType)   
                {   
                    case ".log":   
                        return ne Uri("/AssociationLaunching/FileTypeAssociation.xaml?fileToken=" + fileToken, UriKind.Relative);   
                    default:   
                        return ne Uri("/MainPage.xaml", UriKind.Relative);   
                }   
            }   
            // 由协议启动本 app 时会通过 /Protocol?encodedLaunchUri=ebabcd:xxxxxxxxxx 启动

else if (tempUrl.Startsith("/Protocol"))   
            {   
blog.sina.com.cn/s/blog_be8b33b80101qnd.html
blog.sina.com.cn/s/blog_b077e6ca0101iiz.html
<phone:PhoneApplicationPage

x:Class="Demo.Map.Demo"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True"
blog.sina.com.cn/s/blog_b07ac5fe0101ji7r.html
blog.sina.com.cn/s/blog_b077e6ca0101iix0.html
blog.sina.com.cn/s/blog_b07ac5fe0101ji7s.html
ycool.com/post/89mtbt6
ycool.com/post/zqsurhy
 xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps">   
       
    <Grid x:Name="LayoutRoot" Background="Transparent">   
        <StackPanel>   
       
            <!--   
                Microsoft.Phone.Maps.Controls.Map - 诺基亚地图   
                    CenterChanged - 地图的中心点发生变化时触发的事件   
            -->   
            <maps:Map x:Name="map" idth="480" Height="440" CenterChanged="map_CenterChanged" />   
       
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnRoad" Content="道路图" Click="btnRoad_Click" />   
                <Button Name="btnAerial" Content="卫星图" Click="btnAerial_Click" />

</StackPanel>   
ycool.com/post/pa3saaf
ycool.com/post/f3zxh
ycool.com/post/y5xq8cp
zakinti.lofter.com/post/3cbc16_149b002
zakinti.lofter.com/post/3cbc16_149b038
zakinti.lofter.com/post/3cbc16_149b042
       <StackPanel Orientation="Horizontal">   
                <Button Name="btnHybrid" Content="卫星图叠加道路图" Click="btnHybrid_Click" />   
                <Button Name="btnTerrain" Content="自然地形叠加道路图" Click="btnTerrain_Click" />   
            </StackPanel>   
       
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnZoomIn" Content="放大" Click="btnZoomIn_Click" />   
                <Button Name="btnZoomOut" Content="缩小" Click="btnZoomOut_Click" />

</StackPanel>   
       
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnMoveTop" Content="上移" Click="btnMoveTop_Click" />

<Button Name="btnMoveBottom" Content="下移" Click="btnMoveBottom_Click" />   
                <Button Name="btnMoveLeft" Content="左移" Click="btnMoveLeft_Click" />   
                <Button Name="btnMoveRight" Content="右移" Click="btnMoveRight_Click" />   
            </StackPanel>   
       
            <TextBlock Name="lblMsg" />   
                   
        </StackPanel>   
zakinti.lofter.com/post/3cbc16_149b056
zakinti.lofter.com/post/3cbc16_149b068
blog.sina.com.cn/s/blog_b9cd56120101k11.html
blog.sina.com.cn/s/blog_b9cd56120101k11z.html
/*   
 * 演示诺基亚地图的应用   
 *    
 *    
 * 本例仅用于说明诺基亚地图的基本使用方式,更多的内容,如:路线绘制,图钉等功能请参见 Microsoft.Phone.Maps.Controls.Map 控件文档和 indos Phone Toolkit 文档   
 *    
 *    
www.pf025.net/zlzx/zd/963.html?1401192515
www.pf025.net/zlzx/zd/962.html?1401192518
www.pf025.net/zlzx/zd/961.html?1401192521
www.pf025.net/zlzx/zd/960.html?1401192525
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_MAP" />   
 * 2、相关的 Launcher 参见本项目的 Launchers 文件夹内的地图相关的演示   
 * 3、Bing 地图虽然仍可用,但是能不用就别用了   
 * 4、关于 pin 之类的地图扩展,请使用 indos Phone Toolkit,参见 phone.codeplex.com/   
 *    
 *    
 * 另:与地图相关的协议说明如下,你的 app 如果支持这些协议将会在用户请求时启动(只有你一个 app 支持时)或出现在启动列表中(多个 app 支持时)   
 * 1、驾车到指定地点:ms-drive-to:?destination.latitude=<latitude>&destination.longitude=<longitude>&destination.name=<name>   
 * 2、散步到指定地点:ms-alk-to:?destination.latitude=<latitude>&destination.longitude<longitude>&destin

www.pf025.net/zlzx/zd/967.html?1401192505
www.pf025.net/zlzx/zd/966.html?1401192507
www.pf025.net/zlzx/zd/965.html?1401192509
www.pf025.net/zlzx/zd/964.html?1401192512
       
namespace Demo   
{   
    public class MyUriMapper : UriMapperBase   
    {   
        public override Uri MapUri(Uri uri)   
        {   
            string tempUrl = Utility.UrlDecode(uri.ToString());   
       
            // 由文件启动本 app 时会通过 /FileTypeAssociation?fileToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 启动   
            if (tempUrl.Startsith("/FileTypeAssociation"))   
            {   
                // 获取 fileToken   
                int fileTokenIndex = tempUrl.IndexOf("fileToken=") + 10;   
                string fileToken = tempUrl.Substring(fileTokenIndex);   
       
                // 获取相关的文件名   
                string fileName = SharedStorageAccessManager.GetSharedFileName(fileToken); // myLog.log   
       
blog.sina.com.cn/s/blog_b9d4c9220101kuqb.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqc.html
ation.name=<name>   
 */
       
using System.indos;   
using Microsoft.Phone.Controls;   
using System.Device.Location;   
using Microsoft.Phone.Maps.Controls;   
       
namespace Demo.Map   
{   
    public partial class Demo : PhoneApplicationPage   
    {   
        // 地图的中心点,经纬度坐标   
        private GeoCoordinate _center;   
        // ZoomLevel: 1 - 最小, 20 - 最大   
        private double _zoomLevel = 16;   
        // Heading: 0 到 360 之间的任意数字。例:上为正北则为0,上为正西则为90,上为正南则为180,上为正东则为270   
        private double _heading = 0;   
        // Pitch: 0 到 180 之间的任意数字,代表地图绕 X 轴倾斜的角度(以实现 3D 效果)   
        private double _pitch = 15;   
       
        public Demo()   
blog.sina.com.cn/s/blog_b9d4c9220101kuqg.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqm.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqo.html
   {   
            InitializeComponent();   
       
            this.Loaded += Demo_Loaded;   
        }   
       
        void Demo_Loaded(object sender, RoutedEventArgs e)   
        {   
            map.LandmarksEnabled = true; // 是否显示地标(ZoomLevel 16 级以上才会显示)   
            map.PedestrianFeaturesEnabled = true; // 是否显示步行街(ZoomLevel 16 级以上才会显示)   
            map.ColorMode = MapColorMode.Light; // 颜色模式(Light 或 Dark)   
       
            _center = ne GeoCoordinate(39.909, 116.397);   
       
            // map.Center = _center;   
            // map.ZoomLevel = _zoomLevel;   
            // map.Heading = _heading;   
            // map.Pitch = _pitch;   
       
            // SetVie() - 通过指定的 Center, ZoomLevel, Heading, Pitch, MapAnimationKind 参数来显示地图   
            // MapAnimationKind - 代表地图过渡时的动画效果。None:无动画;Linear:线性动画;Parabolic:抛物线动画   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Parabolic);

blog.sina.com.cn/s/blog_b9d4c9220101kuqt.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqu.html
blog.sina.com.cn/s/blog_b9d4c9220101kuq.html
blog.sina.com.cn/s/blog_b9d4c9220101kuqz.html
     
        private void btnRoad_Click(object sender, RoutedEventArgs e)   
        {   
            // 道路地图   
            map.CartographicMode = MapCartographicMode.Road;   
        }   
       
        private void btnAerial_Click(object sender, RoutedEventArgs e)   
        {   
            // 卫星地图   
            map.CartographicMode = MapCartographicMode.Aerial;   
        }   
       www.pf025.net/zlzx/zd/970.html?1401192498
www.pf025.net/zlzx/zd/969.html?1401192500
www.pf025.net/zlzx/zd/968.html?1401192502
        private void btnHybrid_Click(object sender, RoutedEventArgs e)   
        {   
            // 卫星地图上叠加道路地图   
            map.CartographicMode = MapCartographicMode.Hybrid;   
        }   
       
        private void btnTerrain_Click(object sender, RoutedEventArgs e)   
        {   
            // 自然地形地图上叠加道路地图   
            map.CartographicMode = MapCartographicMode.Terrain;   
        }   
blog.sina.com.cn/s/blog_b9d4c9220101kur2.html
blog.sina.com.cn/s/blog_b9d4c9220101kur5.html
/*   
 * 自定义 UriMapper,用于处理当本 app 由文件打开或协议打开或镜头扩展打开或图片扩展打开时,

导航到相关的处理页面   
 *    
 * 注:   
 * 要使此 UriMapper 有效,需要在 App.xaml.cs 中增加 RootFrame.UriMapper = ne

Demo.MyUriMapper();   
 */
       
using System;   
using System.Collections.Generic;   
using System.IO;   
using System.Net;   
using System.indos.Navigation;   
using indos.Phone.Storage.SharedAcces
blog.sina.com.cn/s/blog_b07ac5fe0101ji7t.html
blog.sina.com.cn/s/blog_b077e6ca0101iix7.html
       private void btnZoomIn_Click(object sender, RoutedEventArgs e)   
        {   
            // 放大地图   
            map.SetVie(_center, ++_zoomLevel, _heading, _pitch, MapAnimationKind.Linear);

}   
       
        private void btnZoomOut_Click(object sender, RoutedEventArgs e)   
        {   
            // 缩小地图   
            map.SetVie(_center, --_zoomLevel, _heading, _pitch, MapAnimationKind.Linear);

www.h-eq.com/kfz/1682.html
www.h-eq.com/kfz/1683.html
www.h-eq.com/kfz/1684.html
        }   
       
        private void btnMoveTop_Click(object sender, RoutedEventArgs e)   
        {   
            // 上移地图,可以看到地图切换时线性过渡的效果(MapAnimationKind.Linear)   
            _center = ne GeoCoordinate(map.Center.Latitude + 0.1, map.Center.Longitude);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Linear);   
        }   
       
        private void btnMoveBottom_Click(object sender, RoutedEventArgs e)   
        {   
            // 下移地图,可以看到地图切换时线性过渡的效果(MapAnimationKind.Linear)   
            _center = ne GeoCoordinate(map.Center.Latitude -0.1, map.Center.Longitude);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Linear);   
        }   
       
blog.sina.com.cn/s/blog_be8b33b80101qn.html
blog.sina.com.cn/s/blog_b07ac5fe0101ji7v.html
blog.sina.com.cn/s/blog_b07ac5fe0101ji7.html
blog.sina.com.cn/s/blog_be8b33b80101qnz.html
    {   
            // 左移地图,可以看到地图切换时抛物线过渡的效果(MapAnimationKind.Parabolic)   
            _center = ne GeoCoordinate(map.Center.Latitude, map.Center.Longitude - 0.1);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Parabolic);

www.h-eq.com/kfz/1678.html
www.h-eq.com/kfz/1679.html
www.h-eq.com/kfz/1681.html
www.h-eq.com/kfz/1680.html
        }   
       
        private void btnMoveRight_Click(object sender, RoutedEventArgs e)   
        {   
            // 右移地图,可以看到地图切换时抛物线过渡的效果(MapAnimationKind.Parabolic)   
            _center = ne GeoCoordinate(map.Center.Latitude, map.Center.Longitude + 0.1);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Parabolic);

}   
       
        private void map_CenterChanged(object sender, MapCenterChangedEventArgs e)   
        {   
            // CenterChanged - 中心点发生变化时触发的事件   
            // 类似的事件还有:CartographicModeChanged, HeadingChanged, PitchChanged, ZoomLevelChanged, VieChanging, VieChanged 等等    
            lblMsg.Text = string.Format("经度:{0},纬度{1}", map.Center.Longitude, map.Center.Latitude);   
        }   
    }   
}
OK
blog.sina.com.cn/s/blog_b07ac5fe0101ji7x.html
blog.sina.com.cn/s/blog_be8b33b80101qnx3.html
blog.sina.com.cn/s/blog_be8b33b80101qnx5.html
blog.sina.com.cn/s/blog_b077e6ca0101iix9.html
介绍
与众不同 indos phone 8.0 之 位置和地图
位置(GPS) - Location API
诺基亚地图
示例
1、演示新 Location API 的应用
GPS/Demo.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.GPS.Demo"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
www.h-eq.com/kfz/1685.html
www.h-eq.com/kfz/1686.html
www.h-eq.com/kfz/1687.html
www.h-eq.com/kfz/1688.html
www.h-eq.com/kfz/1689.html

xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
blog.sina.com.cn/s/blog_b077e6ca0101iixa.html
blog.sina.com.cn/s/blog_be8b15840101hge.html
 */
       
using System.Collections.Generic;   
using System.indos.Navigation;   
using Microsoft.Phone.Controls;   
using System;   
       
namespace Demo.CameraAndPhoto   
{   
    public partial class PhotoAutoUpload : PhoneApplicationPage   
    {   
        public PhotoAutoUpload()   】
.0531jz.cn/lcyl/jkjy/384.html?1401239419
.0531jz.cn/lcyl/jkjy/385.html?1401239459
        {   
            InitializeComponent();   
        }   
       
        protected override void OnNavigatedTo(NavigationEventArgs e)   
        {   
            IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;   
       
            if (queryStrings.ContainsKey("fromConfig"))   
            {   
                lblMsg.Text = "您是通过“设置 -> 应用程序 -> 照片+相机 -> 应用 -> P8 Demo”或者“照片中心 -> 设置 -> 应用 -> P8 Demo”启动本 app 的";   
.0531jz.cn/lcyl/jkjy/381.html?1401239228
.0531jz.cn/lcyl/jkjy/382.html?1401239220
.0531jz.cn/lcyl/jkjy/383.html?1401239217
<Grid x:Name="LayoutRoot">   
        <StackPanel>   
                   
            <TextBlock Name="lblMsg" Textrapping="rap" />   
                   
            <Button x:Name="btnDemo" Content="通过 GPS 获取当前位置" Click="btnDemo_Click" />   
                   
        </StackPanel>   
    </Grid>   
       
       
</phone:PhoneApplicationPage>
blog.sina.com.cn/s/blog_be8b15840101hgf.html
blog.sina.com.cn/s/blog_b077e6ca0101iixc.html
      lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "一般来说,参考 SkyDrive 的话,你应该在这里列出正在上传的图片列表和上传进度,并可以取消或暂停图片的上传任务";   
            }   
                   
            base.OnNavigatedTo(e);   
        }   
www.pf025.com/bzdh/sszaxpfb/tj/1634.html?1401192185
www.pf025.com/bzdh/sszaxpfb/tj/1633.html?1401192189
www.pf025.com/bzdh/sszaxpfb/tj/1632.html?1401192192
www.pf025.com/bzdh/sszaxpfb/tj/1631.html?1401192196
    }   
}
blog.sina.com.cn/s/blog_be8b33b80101qnxb.html
blog.sina.com.cn/s/blog_be8b15840101hgg.html
/*   
 * 演示新 Location API 的应用   
 *    
 * p7 时代的 Location API 也是支持的(能不用就别用了),参见:

.cnblogs.com/ebabcd/archive/2012/08/09/2629636.html   
 *    
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_LOCATION" />   
 * 2、在获取位置数据之前,需要提供隐私策略并得到用户的允许   
 * 3、目前 p 机器的位置提供程序都是 GPS   
 */
       
using System;   
using System.indos;   
using Microsoft.Phone.Controls;   
using indos.Devices.Geolocation;   
       
blog.sina.com.cn/s/blog_13120bf7c0101opja.html
blog.sina.com.cn/s/blog_13120bf7c0101opjc.html
blog.sina.com.cn/s/blog_13120bf7c0101opjd.html
namespace Demo.GPS   
{   
    public partial class Demo : PhoneApplicationPage   
    {   
        // 新的 Location API   
        Geolocator geolocator;   
       www.pf025.com/bzdh/sszaxpfb/tj/1637.html?1401192175
www.pf025.com/bzdh/sszaxpfb/tj/1636.html?1401192179
www.pf025.com/bzdh/sszaxpfb/tj/1635.html?1401192182
        public Demo()   
        {   
            InitializeComponent();   
        }   
       
        protected override void OnNavigatedTo(System.indos.Navigation.NavigationEventArgs e)   
        {   
            geolocator = ne Geolocator();   
       
            // 期望的精度级别(PositionAccuracy.Default 或 PositionAccuracy.High)   
            geolocator.DesiredAccuracy = PositionAccuracy.High;   
            // 期望的数据精度(米)   
            geolocator.DesiredAccuracyInMeters = 50;   
       
            // 移动距离超过此值后,触发 PositionChanged 事件   
            geolocator.MovementThreshold = 100;   
            // 在两次位置更新的时间点中间,请求位置数据的最小间隔(毫秒)   
            geolocator.ReportInterval = 0;   
       
            // 位置更新时触发的事件   
blog.sina.com.cn/s/blog_b9cd56120101k11t.html
blog.sina.com.cn/s/blog_b9cd56120101k11v.html
www.pf025.com/bzdh/sszaxpfb/tj/1644.html?1401192162
www.pf025.com/bzdh/sszaxpfb/tj/1643.html?1401192165
      // 位置服务的状态发生改变时触发的事件   
            geolocator.StatusChanged += geolocator_StatusChanged;   
       
            base.OnNavigatedTo(e);   
        }   
       
        protected override void OnNavigatedFrom(System.indos.Navigation.NavigationEventArgs e)   
        {   
            geolocator.PositionChanged -= geolocator_PositionChanged;   
            geolocator.StatusChanged -= geolocator_StatusChanged;   
            geolocator = null;   
www.pf025.com/bzdh/sszaxpfb/tj/1644.html?1401192162
www.pf025.com/bzdh/sszaxpfb/tj/1643.html?1401192165
www.pf025.com/bzdh/sszaxpfb/tj/1641.html?1401192168
www.pf025.com/bzdh/sszaxpfb/tj/1639.html?1401192171
       
            base.OnNavigatedFrom(e);   
        }   
       
        private async void btnDemo_Click(object sender, RoutedEventArgs e)   
        {   
            try
            {   
                // 获取位置信息   
                Geoposition geoposition = aait geolocator.GetGeopositionAsync();   
       
www.pf025.com/bzdh/sszaxpfb/tj/1641.html?1401192168
www.pf025.com/bzdh/sszaxpfb/tj/1639.html?1401192171
www.pf025.com/bzdh/sszaxpfb/tj/1637.html?1401192175
       lblMsg.Text = "位置精度(米): " + geoposition.Coordinate.Accuracy.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "海拔精度(米): " + geoposition.Coordinate.AltitudeAccuracy.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "纬度: " + geoposition.Coordinate.Latitude.ToString("0.00");

lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "经度: " + geoposition.Coordinate.Longitude.ToString("0.00");   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "海拔(米): " + geoposition.Coordinate.Altitude.ToString();

lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "行进方向(相对于正北的度数): " + geoposition.Coordinate.Heading.ToString();   
www.pf025.com/bzdh/sszaxpfb/tj/1636.html?1401192179
www.pf025.com/bzdh/sszaxpfb/tj/1635.html?1401192182
www.pf025.com/bzdh/sszaxpfb/tj/1634.html?1401192185
www.pf025.com/bzdh/sszaxpfb/tj/1633.html?1401192189
     lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "行进速度(米/秒): " + geoposition.Coordinate.Speed.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "确定位置的时间(UTC0): " + geoposition.Coordinate.Timestamp.ToString("yyyy-MM-dd hh:mm:ss");   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "数据源(Satellite, iFi, Cellular): " + geoposition.Coordinate.PositionSource.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "卫星的位置精度衰减: " + geoposition.Coordinate.SatelliteData.PositionDilutionOfPrecision.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "卫星的水平精度衰减: " + geoposition.Coordinate.SatelliteData.HorizontalDilutionOfPrecision.ToString();   
                lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "卫星的垂直精度衰减: " + geoposition.Coordinate.SatelliteData.VerticalDilutionOfPrecision.ToString();   
www.pf025.com/bzdh/sszaxpfb/tj/1632.html?1401192192
www.pf025.com/bzdh/sszaxpfb/tj/1631.html?1401192196
www.pf025.net/zlzx/zd/970.html?1401192498
www.pf025.net/zlzx/zd/969.html?1401192500
        lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += Environment.NeLine;   
       
                if (geoposition.CivicAddress != null)   
                {   
                    lblMsg.Text = "国家名称: " + geoposition.CivicAddress.Country;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "省名称: " + geoposition.CivicAddress.State;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "城市名称: " + geoposition.CivicAddress.City;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "邮编: " + geoposition.CivicAddress.PostalCode;   
                    lblMsg.Text += Environment.NeLine;   
                    lblMsg.Text = "确定位置的时间(UTC0): " + geoposition.CivicAddress.Timestamp;   
                }   
            }   
            catch (Exception ex)   
            {   
                if ((uint)ex.HResult == 0x80004004)   
                {   
www.pf025.net/zlzx/zd/968.html?1401192502
www.pf025.net/zlzx/zd/967.html?1401192505
www.pf025.net/zlzx/zd/966.html?1401192507
         lblMsg.Text = "定位服务当前是关闭状态,请打开它";   
                }   
                else
                {   
                    lblMsg.Text = ex.ToString();   
                }   
            }   
        }   
       
        // 位置服务的状态变化了   
        void geolocator_StatusChanged(Geolocator sender, StatusChangedEventArgs args)   
        {   
            // 获取位置服务的状态   
            PositionStatus status = geolocator.LocationStatus;   
       
            // 获取位置服务的状态   
            status = args.Status;   
       
            sitch (args.Status)   
            {   
                case PositionStatus.Disabled: // 位置提供程序已禁用,即用户尚未授予应用程序访问位置的权限   
                    break;   
                case PositionStatus.Initializing: // 初始化中   
www.pf025.net/zlzx/by/956.html?1401005194
www.pf025.net/zlzx/by/957.html?1401005191
www.pf025.net/zlzx/by/958.html?1401005189
www.pf025.net/zlzx/by/959.html?1401005187
       break;   
                case PositionStatus.NoData: // 无有效数据   
                    break;   
                case PositionStatus.Ready: // 已经准备好了相关数据   
                    break;   
                case PositionStatus.NotAvailable: // 位置服务传感器不可用   
                    break;   
                case PositionStatus.NotInitialized: // 尚未初始化   
                    break;   
            }   
        }   
       
        // 位置变化了   
        void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)   
        {   
            this.Dispatcher.BeginInvoke(delegate()   
            {   
                Geoposition geoposition = args.Position;   
       
                lblMsg.Text = "纬度: " + geoposition.Coordinate.Latitude.ToString("0.00");

www.pf025.net/zlzx/zd/962.html?1401192518
www.pf025.net/zlzx/zd/961.html?1401192521
www.pf025.net/zlzx/zd/960.html?1401192525

lblMsg.Text += Environment.NeLine;   
                lblMsg.Text += "经度: " + geoposition.Coordinate.Longitude.ToString("0.00");   
            });   
        }   
    }   
}
www.pf025.net/zlzx/by/952.html?1401005205
www.pf025.net/zlzx/by/953.html?1401005203
www.pf025.net/zlzx/by/954.html?1401005200
www.pf025.net/zlzx/by/955.html?1401005197
<phone:PhoneApplicationPage

x:Class="Demo.Map.Demo"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
www.h-eq.com/kfz/1680.html
www.h-eq.com/kfz/1682.html
www.h-eq.com/kfz/1683.html
  mc:Ignorable="d"
    shell:SystemTray.IsVisible="True"
www.h-eq.com/qb/1677.html

www.pf025.net/zlzx/by/950.html?1401005212
www.pf025.net/zlzx/by/951.html?1401005208
           
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps">   
       
    <Grid x:Name="LayoutRoot" Background="Transparent">   
        <StackPanel>   
       
            <!--   
                Microsoft.Phone.Maps.Controls.Map - 诺基亚地图   
                    CenterChanged - 地图的中心点发生变化时触发的事件   
            -->   
            <maps:Map x:Name="map" idth="480" Height="440" CenterChanged="map_CenterChanged" />   
       
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnRoad" Content="道路图" Click="btnRoad_Click" />   
                <Button Name="btnAerial" Content="卫星图" Click="btnAerial_Click" />  
www.h-eq.com/kfz/1684.html
www.h-eq.com/kfz/1685.html
www.h-eq.com/kfz/1686.html
www.h-eq.com/kfz/1687.html
  </StackPanel>   
www.h-eq.com/qb/1673.html
www.h-eq.com/qb/1674.html
www.h-eq.com/qb/1675.html
www.h-eq.com/qb/1676.html
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnHybrid" Content="卫星图叠加道路图" Click="btnHybrid_Click" />   
                <Button Name="btnTerrain" Content="自然地形叠加道路图" Click="btnTerrain_Click" />   
            </StackPanel>   
       
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnZoomIn" Content="放大" Click="btnZoomIn_Click" />   
                <Button Name="btnZoomOut" Content="缩小" Click="btnZoomOut_Click" />

</StackPanel>   
       
            <StackPanel Orientation="Horizontal">   
                <Button Name="btnMoveTop" Content="上移" Click="btnMoveTop_Click" />

www.h-eq.com/qb/1670.html
www.h-eq.com/qb/1671.html
www.h-eq.com/qb/1672.html
 
www.h-eq.com/kfz/1688.html
www.h-eq.com/kfz/1689.html
blog.sina.com.cn/s/blog_b9cd56120101k21c.html
blog.sina.com.cn/s/blog_b9cd56120101k21g.html
 <Button Name="btnMoveBottom" Content="下移" Click="btnMoveBottom_Click" />   
                <Button Name="btnMoveLeft" Content="左移" Click="btnMoveLeft_Click" />   
                <Button Name="btnMoveRight" Content="右移" Click="btnMoveRight_Click" />   
            </StackPanel>   
       
            <TextBlock Name="lblMsg" />   
                   
        </StackPanel>   
    </Grid>   
       enda.so.com/q/1401239887503224
enda.so.com/q/1401240069505336
enda.so.com/q/1401240170507702
www.h-eq.com/qb/1669.html
</phone:PhoneApplicationPage>
blog.sina.com.cn/s/blog_b9cd56120101k21h.html
blog.sina.com.cn/s/blog_b9cd56120101k21i.html
 * 5、后台代理的任务一般是检查是否有没同步到你服务器的图片,如果有没同步的就去同步   
 * 6、当然你不去同步图片到自己的服务器,而是做其他事情,也是没关系的(如果提交 app 时能通过微软审核的话)   
 *    
 *    
 * 注:   
 * 相关的 UriMapper 参见 MyUriMapper.cs   
 * 像 SkyDrive 那样的在图片中心提示还有几个未传项,第三方的 app 是无法做到的   
 *    
 *    
 * 什么是自动上传的图片扩展?   
 * 1、就是可以在“设置 -> 应用程序 -> 照片+相机 -> 应用 -> P8 Demo”或者“照片中心 -> 设置 -> 应用 -> P8 Demo”找到的程序   
 * 2、其资源密集型代理不会有 14 天过期一说,但其他限制都仍然是有的   
 * 3、一般来说你应该在后台代理检查是否有没同步到你服务器的图片,如果有没同步的就去同步   
 * 4、一般来说,你应该在“设置 -> 应用程序 -> 照片+相机 -> 应用 -> P8 Demo”或者“照片中心 -> 设置 -> 应用 -> P8 Demo”进来的页面内列出正
blog.sina.com.cn/s/blog_b9cd56120101k21j.html
blog.sina.com.cn/s/blog_b9cd56120101k21l.html
/*   
 * 演示诺基亚地图的应用   
 *    
 *    
 * 本例仅用于说明诺基亚地图的基本使用方式,更多的内容,如:路线绘制,图钉等功能请参见 Microsoft.Phone.Maps.Controls.Map 控件文档和 indos Phone Toolkit 文档   
 *    
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_MAP" />   
 * 2、相关的 Launcher 参见本项目的 Launchers 文件夹内的地图相关的演示   
 * 3、Bing 地图虽然仍可用,但是能不用就别用了   
 * 4、关于 pin 之类的地图扩展,请使用 indos Phone Toolkit,参见 phone.codeplex.com/   
 *    
enda.so.com/q/1401239563509410
enda.so.com/q/1401239631500220
enda.so.com/q/1401239763501864
enda.so.com/q/1401239830502592

/*   
 * 演示如何将本 app 注册为自动上传的图片扩展   
 *    
 *    
 * 1、需要在 manifest 中增加配置 <Extension TaskID="_default" ExtensionName="Photos_Auto_Upload" ConsumerID = "{5B04B775-356B-4AA0-AAF8-6491FFEA5632}"

/>   
 * 2、需要通过注册一个资源密集型代理,去执行图片处理(一般是上传图库中的新的图片到服务器)

* 3、关于资源密集型代理参见:.cnblogs.com/ebabcd/archive/2012/07/12/2587440.html   
blog.sina.com.cn/s/blog_b9d4c9220101kvkv.html
blog.sina.com.cn/s/blog_b9d4c9220101kvk.html
* 另:与地图相关的协议说明如下,你的 app 如果支持这些协议将会在用户请求时启动(只有你一个 app 支持时)或出现在启动列表中(多个 app 支持时)   
 * 1、驾车到指定地点:ms-drive-to:?destination.latitude=<latitude>&destination.longitude=<longitude>&destination.name=<name>   
 * 2、散步到指定地点:ms-alk-to:?destination.latitude=<latitude>&destination.longitude<longitude>&destin
blog.sina.com.cn/s/blog_b9cd56120101k21h.html
blog.sina.com.cn/s/blog_b9cd56120101k21i.html
blog.sina.com.cn/s/blog_b9cd56120101k21j.html
blog.sina.com.cn/s/blog_b9cd56120101k21l.html

ation.name=<name>   
 */
       
using System.indos;   
blog.sina.com.cn/s/blog_b9d4c9220101kvkx.html
blog.sina.com.cn/s/blog_b9d4c9220101kvl0.html
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <TextBlock x:Name="lblMsg" Textrapping="rap">   
                <Run>请通过如下方式查找支持自动上传的应用:“设置 -> 应用程序 -> 照片+相机 -> 应用”或者“照片中心 -> 设置 -> 应用”</Run>   
                <LineBreak />   
                <Run>你至少会看到一个名为“P8 Demo”的应用,单击它</Run>   
            </TextBlock>   
       
        </StackPanel>   
    </Grid>   
       
       
</phone:PhoneApplicationPage>
.0531jz.cn/lcyl/jkjy/384.html?1401239419
.0531jz.cn/lcyl/jkjy/385.html?1401239459
blog.sina.com.cn/s/blog_b9cd56120101k21c.html
blog.sina.com.cn/s/blog_b9cd56120101k21g.html
using Microsoft.Phone.Controls;   
using System.Device.Location;   
using Microsoft.Phone.Maps.Controls;   
       
namespace Demo.Map   
{   
    public partial class Demo : PhoneApplicationPage   
    {   
        // 地图的中心点,经纬度坐标   
        private GeoCoordinate _center;   
        // ZoomLevel: 1 - 最小, 20 - 最大   
        private double _zoomLevel = 16;   
        // Heading: 0 到 360 之间的任意数字。例:上为正北则为0,上为正西则为90,上为正南则为180,上为正东则为270   
        private double _heading = 0;   
        // Pitch: 0 到 180 之间的任意数字,代表地图绕 X 轴倾斜的角度(以实现 3D 效果)   
        private double _pitch = 15;   
       
        public Demo()   
blog.sina.com.cn/s/blog_b9d4c9220101kvl6.html
blog.sina.com.cn/s/blog_b9d4c9220101kvla.html
<phone:PhoneApplicationPage   
    x:Class="Demo.CameraAndPhoto.PhotoAutoUpload"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"

.0531jz.cn/lcyl/jkjy/381.html?1401239228
.0531jz.cn/lcyl/jkjy/382.html?1401239220
.0531jz.cn/lcyl/jkjy/383.html?1401239217
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
blog.sina.com.cn/s/blog_b9d4c9220101kvlb.html
blog.sina.com.cn/s/blog_b9e5d1ec0101i6b9.html
   {   
            InitializeComponent();   
       
            this.Loaded += Demo_Loaded;   
        }   
       
        void Demo_Loaded(object sender, RoutedEventArgs e)   
        {   
            map.LandmarksEnabled = true; // 是否显示地标(ZoomLevel 16 级以上才会显示)   
            map.PedestrianFeaturesEnabled = true; // 是否显示步行街(ZoomLevel 16 级以上才会显示)   
            map.ColorMode = MapColorMode.Light; // 颜色模式(Light 或 Dark)   
       
            _center = ne GeoCoordinate(39.909, 116.397);   
       
            // map.Center = _center;   
            // map.ZoomLevel = _zoomLevel;   
            // map.Heading = _heading;   
            // map.Pitch = _pitch;   
       
www.h-eq.com/kfz/1687.html
www.h-eq.com/kfz/1688.html
www.h-eq.com/kfz/1689.html
    // SetVie() - 通过指定的 Center, ZoomLevel, Heading, Pitch, MapAnimationKind 参数来显示地图   
            // MapAnimationKind - 代表地图过渡时的动画效果。None:无动画;Linear:线性动画;Parabolic:抛物线动画   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Parabolic);

}   
       
        private void btnRoad_Click(object sender, RoutedEventArgs e)   
        {   
            // 道路地图   
            map.CartographicMode = MapCartographicMode.Road;   
        }   
       
        private void btnAerial_Click(object sender, RoutedEventArgs e)   
        {   
            // 卫星地图   
            map.CartographicMode = MapCartographicMode.Aerial;   
        }   
www.h-eq.com/kfz/1684.html
www.h-eq.com/kfz/1685.html
www.h-eq.com/kfz/1686.html
    private void btnHybrid_Click(object sender, RoutedEventArgs e)   
        {   
            // 卫星地图上叠加道路地图   
            map.CartographicMode = MapCartographicMode.Hybrid;   
        }   
       
        private void btnTerrain_Click(object sender, RoutedEventArgs e)   
        {   
            // 自然地形地图上叠加道路地图   
            map.CartographicMode = MapCartographicMode.Terrain;   
        }   
       
        private void btnZoomIn_Click(object sender, RoutedEventArgs e)   
        {   
            // 放大地图   
            map.SetVie(_center, ++_zoomLevel, _heading, _pitch, MapAnimationKind.Linear);

www.h-eq.com/kfz/1680.html
www.h-eq.com/kfz/1682.html
www.h-eq.com/kfz/1683.html
    sitch (queryStrings["type"])   
                {   
                    case "share":   
                        lblMsg.Text = "由“共享...”打开";   
                        break;   
                    case "edit":   
                        lblMsg.Text = "由“编辑...”打开";   
                        break;   
                    case "rich":   
                        lblMsg.Text = "由“在 P8 Demo 中打开”打开";   
                        break;   
                }   
            }   
       
            // 显示用户选择的图片的预览图   
            if (queryStrings.ContainsKey("token"))   
            {   
                MediaLibrary library = ne MediaLibrary();   
                Picture photoFromLibrary = library.GetPictureFromToken(queryStrings["token"]);   
       
                BitmapImage bitmapFromPhoto = ne BitmapImage();   
                // GetPrevieImage() - 是扩展方法,来自 Microsoft.Xna.Frameork.Media.PhoneExtensions.MediaLibraryExtensions   
                bitmapFromPhoto.SetSource(photoFromLibrary.GetPrevieImage());   
                img.Source = bitmapFromPhoto;   
www.h-eq.com/kfz/1678.html
www.h-eq.com/kfz/1679.html
www.h-eq.com/kfz/1681.html
 
        private void btnZoomOut_Click(object sender, RoutedEventArgs e)   
        {   
            // 缩小地图   
            map.SetVie(_center, --_zoomLevel, _heading, _pitch, MapAnimationKind.Linear);

}   
       
        private void btnMoveTop_Click(object sender, RoutedEventArgs e)   
        {   
            // 上移地图,可以看到地图切换时线性过渡的效果(MapAnimationKind.Linear)   
            _center = ne GeoCoordinate(map.Center.Latitude + 0.1, map.Center.Longitude);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Linear);   
        }   
       
        private void btnMoveBottom_Click(object sender, RoutedEventArgs e)   
        {

www.pf025.net/zlzx/zd/963.html?1401192515
www.pf025.net/zlzx/zd/962.html?1401192518
www.pf025.net/zlzx/zd/961.html?1401192521
www.pf025.net/zlzx/zd/960.html?1401192525
      // 下移地图,可以看到地图切换时线性过渡的效果(MapAnimationKind.Linear)   
            _center = ne GeoCoordinate(map.Center.Latitude -0.1, map.Center.Longitude);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Linear);   
        }   
       
        private void btnMoveLeft_Click(object sender, RoutedEventArgs e)   
        {   
            // 左移地图,可以看到地图切换时抛物线过渡的效果(MapAnimationKind.Parabolic)   
            _center = ne GeoCoordinate(map.Center.Latitude, map.Center.Longitude - 0.1);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Parabolic);

}   
       
        private void btnMoveRight_Click(object sender, RoutedEventArgs e)   
        {   
            // 右移地图,可以看到地图切换时抛物线过渡的效果(MapAnimationKind.Parabolic)   
            _center = ne GeoCoordinate(map.Center.Latitude, map.Center.Longitude + 0.1);   
            map.SetVie(_center, _zoomLevel, _heading, _pitch, MapAnimationKind.Parabolic);

www.pf025.net/zlzx/zd/966.html?1401192507
www.pf025.net/zlzx/zd/965.html?1401192509
www.pf025.net/zlzx/zd/964.html?1401192512
    }   
       
        private void map_CenterChanged(object sender, MapCenterChangedEventArgs e)   
        {   
            // CenterChanged - 中心点发生变化时触发的事件   
            // 类似的事件还有:CartographicModeChanged, HeadingChanged, PitchChanged, ZoomLevelChanged, VieChanging, VieChanged 等等    
            lblMsg.Text = string.Format("经度:{0},纬度{1}", map.Center.Longitude, map.Center.Latitude);   
        }   
    }   
}
blog.sina.com.cn/s/blog_ba2537100101ddzi.html
blog.sina.com.cn/s/blog_ba2537100101ddzj.html
blog.sina.com.cn/s/blog_ba2537100101ddzk.html
8.0 相机和照片: 镜头的可扩展性, 图片的可扩展性, 图片的自动上传扩展
介绍
与众不同 indos phone 8.0 之 相机和照片
镜头的可扩展性
图片的可扩展性
www.pf025.net/zlzx/zd/969.html?1401192500
www.pf025.net/zlzx/zd/968.html?1401192502
www.pf025.net/zlzx/zd/967.html?1401192505
图片的自动上传扩展
示例
1、演示如何将本 app 注册为镜头扩展
CameraAndPhoto/LensExtensibility.xaml
<phone:PhoneApplicationPage   
    x:Class="Demo.CameraAndPhoto.LensExtensibility"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
blog.sina.com.cn/s/blog_ba2537100101ddzl.html
blog.sina.com.cn/s/blog_b077e6ca0101ijgp.html
private void btnPhotoCapture_Click(object sender, System.indos.RoutedEventArgs e)

{   
            NavigationService.Navigate(ne Uri("/CameraAndPhoto/PhotoCaptureDeviceDemo.xaml", UriKind.Relative));   
        }   
       
        private void btnAudioVideoCapture_Click(object sender, System.indos.RoutedEventArgs e)   
        {   
            NavigationService.Navigate(ne Uri("/CameraAndPhoto/AudioVideoCaptureDeviceDemo.xaml", UriKind.Relative));   
        }   
    }   
}

blog.sina.com.cn/s/blog_b077e6ca0101ijgq.html
blog.sina.com.cn/s/blog_b077e6ca0101ijgs.html
 shell:SystemTray.IsVisible="True">   
       
    <Grid Background="Transparent">   
        <StackPanel Orientation="Vertical">   
       
            <TextBlock x:Name="lblMsg" Text="启动相机后,可以通过“滤镜”启动本 app" />   
       
            <Button x:Name="btnPhotoCapture" Content="用此 app 照相" Click="btnPhotoCapture_Click" />   
       
            <Button x:Name="btnAudioVideoCapture" Content="用此 app 录像" Click="btnAudioVideoCapture_Click" />   
       
        </StackPanel>   
    </Grid>   
       
blog.sina.com.cn/s/blog_b077e6ca0101ijgu.html
blog.sina.com.cn/s/blog_b07ac5fe0101jirj.html
<phone:PhoneApplicationPage   
    x:Class="Demo.CameraAndPhoto.PhotoExtensibility"
    xmlns="schemas.microsoft.com/infx/2006/xaml/presentation"

www.lawceo.net/zlzx/by/980.html?1401273600
www.lawceo.net/zlzx/by/979.html?1401273600
www.lawceo.net/zlzx/by/978.html?1401273602
www.lawceo.net/zlzx/by/977.html?1401273604
    xmlns:x="schemas.microsoft.com/infx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">   
www.pf025.com/bzdh/sszaxpfb/tj/1632.html?1401192192
www.pf025.com/bzdh/sszaxpfb/tj/1631.html?1401192196
www.pf025.net/zlzx/zd/970.html?1401192498
blog.sina.com.cn/s/blog_b07ac5fe0101jirk.html
blog.sina.com.cn/s/blog_b07ac5fe0101jirl.html
</phone:PhoneApplicationPage>
CameraAndPhoto/LensExtensibility.xaml.cs
/*   
 * 演示如何将本 app 注册为镜头扩展   
 *    
 * 1、需要在 manifest 中增加配置 <Extension TaskID="_default"

ExtensionName="Camera_Capture_App" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5631}" />   
 * 2、在 Assets 根文件夹内添加 3 个文件,作为镜头选取器的图标   
 *    Lens.Screen-VGA.png - 800*480  15:9   
 *    Lens.Screen-XGA.png - 1280*768 15:9   
 *    Lens.Screen-720p.png - 1280*720 16:9   
 *    
 *    
www.pf025.com/bzdh/sszaxpfb/tj/1644.html?1401192162
www.pf025.com/bzdh/sszaxpfb/tj/1643.html?1401192165
www.pf025.com/bzdh/sszaxpfb/tj/1641.html?1401192168
 * 注:   
 * 相关的 UriMapper 参见 MyUriMapper.cs   
 *    
 *    
 * 什么是镜头扩展?   
 * 就是打开相机后,单击“滤镜”按钮,会出现一排 app 列表,这里的每一个 app 就是一个镜头扩展程序   
 */
       
using System.Collections.Generic;   
using System.indos.Navigation;   
using Microsoft.Phone.Controls;   
using System;   
       
namespace Demo.CameraAndPhoto   
{   
    public partial class LensExtensibility : PhoneApplicationPage   
    {   
www.pf025.com/bzdh/sszaxpfb/tj/1639.html?1401192171
www.pf025.com/bzdh/sszaxpfb/tj/1637.html?1401192175
www.pf025.com/bzdh/sszaxpfb/tj/1636.html?1401192179
    public LensExtensibility()   
        {   
            InitializeComponent();   
        }   
       
        protected override void OnNavigatedTo(NavigationEventArgs e)   
        {   
            IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;   
       
            if (queryStrings.ContainsKey("fromLens"))   
            {   
                lblMsg.Text = "您是通过相机的“滤镜”启动本 app 的";   
            }   
       
            base.OnNavigatedTo(e);   
        }   
       
www.pf025.com/bzdh/sszaxpfb/tj/1635.html?1401192182
www.pf025.com/bzdh/sszaxpfb/tj/1634.html?1401192185
www.pf025.com/bzdh/sszaxpfb/tj/1633.html?1401192189
  <Grid x:Name="LayoutRoot" Background="Transparent">   
        <StackPanel>   
       
            <TextBlock Name="lblMsg" Textrapping="rap" Text="用此 app 照个照片,然后再在照片中心打开该照片,再打开上下文菜单,以查看图片扩展的效果" />   
                   
            <Image Name="img" idth="320" Height="240" Margin="0 10 0 0" />   
                   
        </StackPanel>   
    </Grid>   
       
</phone:PhoneApplicationPage>
/*   
 * 演示如何将本 app 注册为图片扩展   
 *    
 *    
 * 1、注册为“共享”扩展:在照片中心的图片的上下文菜单中,单击“共享...”,弹出的 app 列表窗口包含此 app,需要在 manifest 中增加 <Extension TaskID="_default" ExtensionName="Photos_Extra_Share" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" />   
 *    
 * 2、注册为“编辑”扩展:在照片中心的图片的上下文菜单中,单击“编辑...”,弹出的 app 列表窗口包含此 app,需要在 manifest 中增加 <Extension TaskID="_default" ExtensionName="Photos_Extra_Image_Editor" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" />   
 *    p7 时代的做法(与图片的上下文菜单“应用程序...”关联)在 p8 中已经遭到了弃用,参考:.cnblogs.com/ebabcd/archive/2012/07/26/2609357.html    
 *    
 * 3、注册为“Photos_Rich_Media_Edit”扩展:会有以下两个特性,以 app 的名字为“P8 Demo”为例,需要在 manifest 中增加 <Extension TaskID="_default" ExtensionName="Photos_Rich_Media_Edit" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5632}" />   
 *    a) 在照片中心打开由此 app 拍摄的照片时,在屏幕的左下角会有一段文字“由 P8 Demo 拍摄”   
 *    b) 在照片中心打开由此 app 拍摄的照片后,在其上下文菜单中会多出一项“在 P8 Demo 中打
wwwwww.pf025.com/bzdh/xjxpfb/mny/1663.html?1401273407
wwwwww.pf025.com/bzdh/xjxpfb/mny/1662.html?1401273414
wwwwww.pf025.com/bzdh/xjxpfb/mny/1661.html?1401273416
wwwwww.pf025.com/bzdh/xjxpfb/mny/1660.html?1401273418

开”   
 *    
 *    
 * 注:   
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_MEDIALIB_PHOTO" />   
 * 2、相关的 UriMapper 参见 MyUriMapper.cs   
 */
       
using System.Collections.Generic;   
using System.indos.Navigation;   
using Microsoft.Phone.Controls;   
wwwwww.pf025.com/bzdh/xjxpfb/mny/1659.html?1401273420
wwwwww.pf025.com/bzdh/xjxpfb/mny/1658.html?1401273423
wwwwww.pf025.com/bzdh/xjxpfb/mny/1657.html?1401273425
using Microsoft.Xna.Frameork.Media;   
using System.indos.Media.Imaging;   
using Microsoft.Xna.Frameork.Media.PhoneExtensions;   
       
namespace Demo.CameraAndPhoto   
{   
    public partial class PhotoExtensibility : PhoneApplicationPage   
    {   
        public PhotoExtensibility()   
        {   
            InitializeComponent();

wwwwww.pf025.com/bzdh/xjxpfb/mny/1656.html?1401273428
wwwwww.pf025.com/bzdh/xjxpfb/mny/1655.html?1401273431
wwwwww.pf025.com/bzdh/xjxpfb/mny/1654.html?1401273434
wwwwww.pf025.com/bzdh/xjxpfb/mny/1653.html?1401273438
        }   
       
        protected override void OnNavigatedTo(NavigationEventArgs e)   
        {   
            IDictionary<string, string> queryStrings = this.NavigationContext.QueryString;   
       
            if (queryStrings.ContainsKey("type"))   
            {   UIScrollView类为显示内容的视图大小大于应用程序窗口提供支持。它使用户能够在该内容中通过轻 扫手势进行滚动,通过手捏手势放大和缩小视图中的内容。
分页
当取景范围里有多个视 图时,你不希望拖动后界面停在中间连接位置,就需要分页功能
CGRect screenRect =

[self.window bounds];  
CGRect bigRect = screenRect;  
www.lawceo.net/zlzx/by/976.html?1401273607
www.lawceo.net/zlzx/by/975.html?1401273609
www.lawceo.net/zlzx/by/974.html?1401273612
www.lawceo.net/zlzx/by/973.html?1401273615
bigRect.size.width *= 2.0;  
      
//初始化ScrollView  
UIScrollView *scrollView = [UIScrollView alloc] initWithFrame:screenRect];  
[self.window addSubview:scrollView];  
      
//创建一个自定义视图对象,并加入到ScrollView中  
MyView *view = [MyView alloc] initWithFrame:screenRect];  
[scrollView addSubview:view];  
www.lawceo.net/zlzx/by/972.html?1401273618
www.lawceo.net/zlzx/by/971.html?1401273625
www.lawceo.net/zlzx/by/972.html?1401273638
www.wh-eq.com/lnb/1700.html
      
//创建另一个对象,使其正好在屏幕外,在上一个视图的右侧  
screenRect.origin.x = screenRect.size.width;  
MyView *anotherView = [MyView alloc] initWithFrame:screenRect];  
[scrollView addSubview:anotherView];
完成基本设置,在UIScrollView中有两个属性, contentSize和pagingEnabled,前者决定了UIScrollView的取景范围,后者是设置是否系统自动分页
[scrollView setContentSize:bigRect.size];  
[scrollView setPagingEnabled:YES];

www.wh-eq.com/lnb/1699.html
www.wh-eq.com/lnb/1698.html
www.wh-eq.com/lnb/1697.html
www.wh-eq.com/lnb/1696.html
缩放
假设你这个应用里有个视图成员,你想实 现他的放大缩小功能
CGRect screenRect = [self.window bounds];  
      
//初始化ScrollView,并设置它的缩放规模,实现委托  
UIScrollView *scrollView = [UIScrollView alloc] initWithFrame:screenRect];  
      
[scrollView setMinimumZoomScale:1.0];  
[scrollView setMaximumZoomScale:5.0];  
      
[scrollView setDelegate:self];  
      
[self.window addSubview:scrollView];  
      
//初始化成员  
myView = [MyView alloc] initWithFrame:screenRect];
要让该滚动视图实现缩放功能,就需 要遵守UIScrollViewDelegate协议,然后实现委托方法
- (UIView *)

viewForZoomingInScrollView:(UIScrollView *)scrollView  
{  
   return myView;  
}
www.wh-eq.com/lnb/1695.html
www.wh-eq.com/lnb/1694.html
www.wh-eq.com/lnb/1693.html
www.wh-eq.com/lnb/1692.html
ReactiveCocoa(其简称为RAC)是由Github 开源的一个应用于iOS和OS X开发的新框架。RAC具有函 数式编程和响应式编程的特性。它主要吸取了.Net的 Reactive Extensions的设计和实现。本文将详细 介绍该框架试图解决什么问题,以及其用法与特点。
ReactiveCocoa试图解决什么问题
经过一段时间的研究,我认为ReactiveCocoa试图解决以下3个问题:
传统iOS开发过程中,状态以及状态之间依赖过多的问题
传统MVC架构的问题:Controller比较复杂,可测试性差
提供统一的消息传递机制
传统iOS开发过程中,状态以及状态之间依赖过多的问题
我们在开发iOS应用时,一个界面元素的状态很可能受多个其它界面元素或后台状态的影响。
例如,在用户帐户的登录界面,通常会有2个输入框(分别输入帐号和密码)和一个登录按钮。如果 我们要加入一个限制条件:当用户输入完帐号和密码,并且登录的网络请求还未发出时,确定按钮才可 以点击。通常情况下,我们需要监听这两个输入框的状态变化以及登录的网络请求状态,然后修改另一 个控件的enabled状态。
传统的写法如下(该示例代码修改自ReactiveCocoa官网 ) : https://github.com/ReactiveCocoa/ReactiveCocoa
static void *ObservationContext = &ObservationContext;
(void)viewDidLoad {
    [super viewDidLoad];
    
    [LoginManager.sharedManager addObserver:self
             forKeyPath:@"loggingIn"
                                    options:NSKeyValueObservingOptionInitial
             context:&ObservationContext];
    [self.usernameTextField addTarget:self action:@selector(updateLogInButton)
             forControlEvents:UIControlEventEditingChanged];
    [self.passwordTextField addTarget:self action:@selector(updateLogInButton)
            forControlEvents:UIControlEventEditingChanged];
}

- (void)updateLogInButton {
    BOOL textFieldsNonEmpty = self.usernameTextField.text.length > 0 
&& self.passwordTextField.text.length > 0;
    BOOL readyToLogIn = !LoginManager.sharedManager.isLoggingIn && !self.loggedIn;
    self.logInButton.enabled = textFieldsNonEmpty && readyToLogIn;
}www.wh-eq.com/lnb/1691.html
blog.sina.com.cn/s/blog_b9cd56120101k2tm.html
blog.sina.com.cn/s/blog_b9cd56120101k2tp.html
blog.sina.com.cn/s/blog_b9cd56120101k2ts.html
blog.sina.com.cn/s/blog_b9cd56120101k2tw.html
blog.sina.com.cn/s/blog_b9cd56120101k2tz.htmlRAC通过引入信号(Signal)的概念,来代替传统iOS开发中对于控件状态变化检查的代理(delegate )模式或target-action模式。因为RAC的信号是可以组合(combine)的,所以可以轻松地构造出另一个 新的信号出来,然后将按钮的enabled状态与新的信号绑定。如下所示:
RAC(self.logInButton, enabled) = [RACSignal
    combineLatest:@[
        self.usernameTextField.rac_textSignal,
        self.passwordTextField.rac_textSignal,
        RACObserve(LoginManager.sharedManager, loggingIn),
        RACObserve(self, loggedIn)
    ] reduce:^(NSString *username, NSString *password, NSNumber *
loggingIn, NSNumber *loggedIn) {
        return @(username.length > 0 && password.length > 0 && !
loggingIn.boolValue && !loggedIn.boolValue);
blog.sina.com.cn/s/blog_b9cd56120101k2u0.html
blog.sina.com.cn/s/blog_b9cd56120101k2u1.html
blog.sina.com.cn/s/blog_b9cd56120101k2u4.html
blog.sina.com.cn/s/blog_b9cd56120101k2u5.html
blog.sina.com.cn/s/blog_b9cd56120101k2u9.html
    }];
可以看到,在引入RAC之后,以前散落在action-target或KVO的回调函数中的判断逻辑被统一到了一 起,从而使得登录按钮的enabled状态被更加清晰地表达了出来。
除了组合(combine)之外,RAC的信号还支持链式(chaining)和过滤(filter),以方便将信号进 行进一步处理。
试图解决MVC框架的问题
对于传统的Model-View-Controller(zh.wikipedia.org/zh-cn/MVC)的框架,Controller很容 易变得比较庞大和复杂。由于Controller承担了Model和View之间的桥梁作用,所以Controller常常与对 应的View和Model的耦合度非常高,这同时也造成对其做单元测试非常不容易,对iOS工程的单元测试大 多都只在一些工具类或与界面无关的逻辑类中进行。
RAC的信号机制很容易将某一个Model变量的变化与界面关联,所以非常容易应用Model-View- ViewModel(en.wikipedia.org/wiki/Model_View_ViewModel) 框架。通过引入ViewModel层,然 后用RAC将ViewModel与View关联,View层的变化可以直接响应ViewModel层的变化,这使得Controller变 得更加简单,由于View不再与Model绑定,也增加了View的可重用性。
因为引入了ViewModel层,所以单元测试可以在ViewModel层进行,iOS工程的可测试性也大大增强了 。InfoQ也曾撰文介绍过MVVM:《MVVM启示录》:www.infoq.com/cn/articles/mvvm- revelation/ 。
统一消息传递机制
blog.sina.com.cn/s/blog_b9cd56120101k2ua.html
blog.sina.com.cn/s/blog_b9cd56120101k2ub.html
blog.sina.com.cn/s/blog_b9cd56120101k2ud.html
blog.sina.com.cn/s/blog_b9cd56120101k2uf.html
blog.sina.com.cn/s/blog_b9cd56120101k2ug.html
iOS开发中有着各种消息传递机制,包括KVO、Notification、delegation、block以及target-action 方式。各种消息传递机制使得开发者在做具体选择时感到困惑,例如在objc.io上就有专门撰文
www.objc.io/issue-7/communication-patterns.html
(破船的翻译:beyondvincent.com/blog/2013/12/14/124-communication-patterns/ ), 介绍各种消息传递机制之间的差异性。
RAC将传统的UI控件事件进行了封装,使得以上各种消息传递机制都可以用RAC来完成。示例代码如下 :

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
                        change:(NSDictionary *)change context:(void *)context {
    if (context == ObservationContext) {
        [self updateLogInButton];
    } else {
        [super observeValueForKeyPath:keyPath ofObject:object
                               change:change context:context];
    }
}
// KVO
[RACObserve(self, username) subscribeNext:^(id x) {
    NSLog(@"成员变量 username 被修改成了:%@", x);
}];
blog.sina.com.cn/s/blog_b9cd56120101k2uj.html
blog.sina.com.cn/s/blog_b9cd56120101k2uk.html
blog.sina.com.cn/s/blog_b9d4c9220101kwa9.html
blog.sina.com.cn/s/blog_b9d4c9220101kwab.html

// target-action
self.button.rac_command = [[RACCommand alloc] initWithSignalBlock:
^RACSignal *(id input) {
    NSLog(@"按钮被点击");
    return [RACSignal empty];
}];

// Notification
[NSNotificationCenter.defaultCenter addObserver:self 
        selector:@selector(keyboardDidChangeFrameNotificationHandler:) 
        name:UIKeyboardDidChangeFrameNotification object:nil]; 
RAC的RACSignal 类也提供了createSignal方法来让用户创建自定义的信号,如下代码创建了一个下 载指定网站内容的信号。
(RACSignal *)urlResults {
    return [RACSignal createSignal:^RACDisposable *(id subscriber) {

NSError *error;         NSString *result = [NSString 
blog.sina.com.cn/s/blog_b9d4c9220101kwat.html
blog.sina.com.cn/s/blog_b9d4c9220101kwav.html
blog.sina.com.cn/s/blog_b9d4c9220101kwaz.html
blog.sina.com.cn/s/blog_b9d4c9220101kwb4.html
stringWithContentsOfURL:             [NSURL

URLWithString:@"www.devtang.com"]

encoding:NSUTF8StringEncoding   error:&error];

NSLog(@"download");         if (!result) {

[subscriber sendError:error];       
blog.sina.com.cn/s/blog_b9d4c9220101kwb8.html
blog.sina.com.cn/s/blog_b9d4c9220101kwba.html
blog.sina.com.cn/s/blog_b9d4c9220101kwbd.html

} else {             [subscriber sendNext:result];

[subscriber sendCompleted];

}         return [RACDisposable disposableWithBlock:^{

NSLog(@"clean up");

}];     }];  }
blog.sina.com.cn/s/blog_b9d4c9220101kwbe.html
blog.sina.com.cn/s/blog_b9d4c9220101kwbm.html
blog.sina.com.cn/s/blog_b9d4c9220101kwbn.html
blog.sina.com.cn/s/blog_b9d4c9220101kwbp.html
如何使用ReactiveCocoa
libReactiveCocoa-iOS.a文件。
开发者也可以用CocoaPods来设置目标工程对ReactiveCocoa的依赖,只需要编辑Podfile文件,增加 如下内容即可:
pod 'ReactiveCocoa', ‘2.0'
ReactiveCocoa的特点
RAC在应用中大量使用了block,由于Objective-C语言的内存管理是基于引用计数 的,为了避免循环 引用问题,在block中如果要引用self,需要使用@weakify(self)和@strongify(self)来避免强引用。另 外,在使用时应该注意block的嵌套层数,不恰当的滥用多层嵌套block可能给程序的可维护性带来灾难 。
RAC的编程方式和传统的MVC方式差异巨大,所以需要较长的学习时间。并且,业界内对于RAC并没有 广泛应用,这造成可供参考的项目和教程比较欠缺。另外,RAC项目本身也还在快速演进当中,1.x版本 和2.x版本API改动了许多,3.0版本也正在快速开发中,对它的使用也需要考虑后期的升级维护问题。

blog.sina.com.cn/s/blog_b9e5d1ec0101i737.html
blog.sina.com.cn/s/blog_ba24b8400101k28q.html
blog.sina.com.cn/s/blog_ba24b8400101k28s.html
blog.sina.com.cn/s/blog_ba24b8400101k28u.html
作为一个iOS开发领域的新开源框架,ReactiveCocoa带来了函数式编程和响应式编程的思想,值得大 家关注并且学习。
今天晚上,越狱梦之队evad3rs搞了个突然袭击,悄无声息的放出了iOS 7完美越狱工具,支持所有可 升级至iOS 7的iPhone、iPod touch、iPad、和iPad mini,版本方面则支持iOS 7到7.0.4中的任何版本 。下面我们为大家带来完美越狱教程。
越狱前注意事项如下:
1、使用evasi0n工具之前请使用iTunes或者iCloud备份你的iOS设备,这样在越狱碰到意外时,可确 保不会丢失你的数据。
2、在使用evasi0n之前,请关闭密码锁,否则可能会导致一些意外发生。
3、在越狱过程中要保持耐心,请不要同时启动iTunes或Xcode。最好的方法就是在越狱完成之前,不 要去碰你的电脑。
4、如果越狱过程中某个进程被卡住,那就放心的重启你的设备,不会对越狱造成 任何影响

blog.sina.com.cn/s/blog_ba24b8400101k28w.html
blog.sina.com.cn/s/blog_ba24b8400101k28x.html
blog.sina.com.cn/s/blog_ba24b8400101k28y.html
blog.sina.com.cn/s/blog_ba24b8400101k292.html
  
UIView对象一般都是由alloc和init方法创建的,由UIViewController进行维护和管理。一般需要完 成的任务有:创建视图,显示视图,隐藏视图和释放视图。
一般视图不会在程序运行时立刻创建 并载入,只有当应用需要这个视图的时候才会创建,这种延迟创建视图的方法能够提高内存的使用效率 。同样,在需要这个视图之前,系统会检查是不是已经载入过这个视图,如果是,直接返回创建过的 view,如果没有,则开始创建过程
- (void)loadView
载入视图过程中执行代码
- (void)viewDidLoad
视图载入完成需要执行的代码

blog.sina.com.cn/s/blog_ba2537100101deo6.html
blog.sina.com.cn/s/blog_ba2537100101deo9.html
blog.sina.com.cn/s/blog_ba2537100101deoa.html
blog.sina.com.cn/s/blog_ba2537100101deoc.html
- (void)viewDidUnload
卸载视图代 码
一个视图切换到另一个视图的时候,之前那个视图并不会被清除,还会留在内存中等待系统调 用,所以一个视图在使用到卸载过程中虽然可能多次出现,但是只会载入一次,也就是调用一次 loadView和viewDidLoad方法。
在IOS6以前,在系统接收到Memory Warning时,会调用 viewDidUnload这个方法,对视图进行卸载清空。但是IOS6以后这个方法已经不再被使用了,文档里是这 么描述的

这里给出的解释是, 视图不再在低内存的情况下被清除了。苹果公司WWDC2012对这个方法的告别陈述
The method viewWillUnload and viewDidUnload. We’re not going to call them anymore. I mean, there’s kind of a cost-benifit equation and analysis that we went through. In the early days, there was a real performance need for us to ensure that on memory warnings we unloaded views. There was all kinds of graphics and backing stores and so forth that would also get unloaded. We now unload those independently of the view, so it isn’t that big of a deal for us for those to be unloaded, and there were so many bugs where there would be pointers into。
具体为什么不需要清空view呢,下面解释了原因(摘自唐巧的《再见,viewDidUnload方法》 )
1.UIView有一个CALayer的成员变量,CALayer是具体用于将自己画到屏幕上
blog.sina.com.cn/s/blog_ba24b8400101k295.html
blog.sina.com.cn/s/blog_ba24b8400101k296.html
blog.sina.com.cn/s/blog_ba24b8400101k29d.html
blog.sina.com.cn/s/blog_ba2537100101deo5.html
这几天因为住的地方的网出了一点问题,除了能上Q,上微博以外其他的网页全都无法登陆。博客也 就没有跟进。
今天恢复了,所以继续更新博客。也希望大家能继续评论或私自给我一些建议或者 交流:-)
今天找到了以前一个TableView的例子,主要关于上下拉刷新的,所以写了一个demo,然 后更新到博客上来。
内置刷新
内置刷新是苹果IOS6以后才推出的一个API,主要是针对 TableViewController增加了一个属性,refreshControl,所以如果想用这个内置下拉刷新的话,最好给 你的TableView指定一个专门的视图控制器了。

blog.sina.com.cn/s/blog_ba2537100101deog.html
blog.sina.com.cn/s/blog_ba2537100101deoi.html
blog.sina.com.cn/s/blog_ba2537100101deol.html
blog.sina.com.cn/s/blog_ba2537100101depc.html
由于授权问题,在较新的Linux发行版本中都不再包含Oracle Java,取而代之的是OpenJDK。Ubuntu 也是如此。
OpenJDK能满足大部分的应用程序运行条件,但PyCharm无法在OpenJDK条件下运行,因此需要安装 Oracle公司的JDK。
首先到JetBrain官网选择对应操作系统的最新版PyCharm下载。如果使用虚拟机,可以先在主机中用 迅雷下载,然后传输到虚拟机中使用。下载后的文件应该是.tar.gz格式,在Ubuntu中解压到自己选择的 路径后即可使用。
运行方式为在命令行中进入应用根目录,执行:
$ ./bin/pycharm.sh
因为我的是新做的虚拟机,命令行提示JDK错误。
安装JDK
在Ubuntu中安装JDK有不同方法,这里提供一种个人觉得最简单的方法,使用apt安装。
因为版权问题,在Ubuntu的APT仓库中不提供Oracle Java下载,执行以下命令查看:
$ apt-cache search oracle-java
搜索不到任何包,再次查看:
$ apt-cache search java7
default-jdk - Standard Java or Java compatible Development Kit
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
openjdk-7-jdk - OpenJDK Development Kit (JDK)
openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
使用的话,我们需要给refreshControl指定一个 UIRefreshControl对象。跟进到头文
blog.sina.com.cn/s/blog_ba2537100101depg.html
blog.sina.com.cn/s/blog_ba2537100101depl.html
blog.sina.com.cn/s/blog_ba2537100101depm.html
blog.sina.com.cn/s/blog_ba2537100101depo.html
只可以搜索到OpenJDK的相关包。
因为授权问题,Oracle JDK不包含在官方的PPA列表中,但感谢那些自由软件的贡献者,他们制作了 一个PPA可以从Oracle官方下载最新版JDK到本地,自动安装和升级。注意的是这个PPA是一个alpha版本 ,作者不承诺任何保障,使用者自己承担风险。(PPA:Personal Package Archive)
执行以下命令添加PPA,然后更新APT。
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
更新完成后再搜索一下JDK包:
$ sudo apt-cache search oracle-java
oracle-jdk7-installer - Oracle JDK7 Installer meta package
oracle-java7-installer - Oracle Java(TM) Development Kit (JDK) 7
oracle-java6-installer - Oracle Java(TM) Development Kit (JDK) 6
oracle-java8-installer - Oracle Java(TM) Development Kit (JDK) 8
oracle-java7-set-default - Set Oracle JDK 7 as default Java
oracle-java6-set-default - Set Oracle JDK 6 as default Java
oracle-java8-set-default - Set Oracle JDK 8 as default Java
搜索到了最新的JDK,我选择了安装Java7,执行:
sudo apt-get install oracle-java7-installer
安装都是自动完成的,中间会弹出提示要求接受Oracle的授权条款,全部同意就可以了。
如果需要设置环境变量可以执行:
sudo apt-get install oracle-java7-set-default
如果安装过oracle-java6-set-default或者oracle-java8-set-default,它们将被自动替换为当前的 设置。
好了,再次运行PyCharm试试吧,执行:

blog.sina.com.cn/s/blog_ba2537100101depp.html
blog.sina.com.cn/s/blog_ba2537100101dept.html
blog.sina.com.cn/s/blog_ba2537100101depu.html
成功启动程序,第一次运行会要求输入序列号正版验证:
++++++++++
+ User name +
++++++++++
EMBRACE
    
+++++++++++
+  License Key +
+++++++++++
14203-12042010
0000107Iq75C621P7X1SFnpJDivKnX
6zcwYOYaGK3euO3ehd1MiTT"2!Jny8
bff9VcTSJk7sRDLqKRVz1XGKbMqw3G
 PyCharm 3.0.1第一次打开时,会自动询问是否要创建桌面快捷方式和Laucher。
Please enter your password to create a desktop entry
    
[sudo] password for ifantastic: 
    
Press Enter to close this window...
    
    
Please enter your password to create a launcher script in a '/usr/local/bin'
    
[sudo] password for ifantastic: 
blog.sina.com.cn/s/blog_ba2537100101depx.html
blog.sina.com.cn/s/blog_ba2537100101depy.html
blog.sina.com.cn/s/blog_ba2537100101depz.html
blog.sina.com.cn/s/blog_ba2537100101deq0.html
Press Enter to close this window...
谢谢。
查阅了很多方法,包括对内核打补丁,都不是很理想。其实iwl3945对于其他intel 3945的芯片的支 持还是挺好的,比如dell d630中的无线网卡(芯片是8086:4222),但是,我的x60中的无限网卡,芯片 是8086:4227的。最终选择使用ndiswrapper+无线网卡驱动for windows。参见这里
如何查看无限网卡芯片:
lspci
找到表示无限网卡的一行,看看最开头,就是你的网卡信息。
比如:
03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
那么,03:00.0就是所求。
然后运行
lspci -n
找到和刚此型号对应的行,如:
03:00.0 0280: 8086:4227 (rev 02)
那么,无线网卡的芯片就是8086:4227的。
-----------------------------------------------------我是分割线------------------------ ----------------------------------
警告:本教程存在一定的风险,请谨慎使用,使用前请将相关文件备份。因为使用本教程带来的任何 损失,本人概不负责。
本文中用到的所有文件,都可以在这里一次性下载。
自从升级到ubuntu 8.04之后,自己的ibm x60上的无线网卡就变的很不稳定。
症状
具体症状如下:
1. 可以识别无线网络,可以链接到无线网络。
2. 刚连接上之后一段时间,速度还不错。
3. 过一段时间,网络就变的很慢很慢,有时候是没有速度,有时候会断线。
4. 期间偶尔会变好。
总体来说,就是无线网卡不稳定。
于是很无奈的,我的笔记本只能天天插着网线上网了。

Python标准库之xml.etree.ElementTree相关推荐

  1. Python 标准库之 xml.etree.ElementTree xml解析

    Python 标准库之 xml.etree.ElementTree Python中有多种xml处理API,常用的有xml.dom.*模块.xml.sax.*模块.xml.parser.expat模块和 ...

  2. python etree库_python 标准库之xml.etree.ElementTree

    简介 Element类型是一种灵活的容器对象,用于在内存中存储结构化数据. [注意]xml.etree.ElementTree模块在应对恶意结构数据时显得并不安全. 每个element对象都具有以下属 ...

  3. xml 属性value换行显示_python 标准库之xml.etree.ElementTree

    简介 Element类型是一种灵活的容器对象,用于在内存中存储结构化数据. [注意]xml.etree.ElementTree模块在应对恶意结构数据时显得并不安全. 每个element对象都具有以下属 ...

  4. Python 标准库之 XML(下)

    本文作者:Rocky0249 公众号:Python空间 写在之前 隔了1天了,不知道你们还记得上一篇文章的内容不,如果不记得的话请移步 -- Python 标准库之 XML(上). 今天我们继续来学习 ...

  5. python【模块】xml.etree.ElementTree 解析 xml

    pytho 模块 xml.etree.ElementTree 解析 xml 文章目录 pytho 模块 xml.etree.ElementTree 解析 xml 1. 什么是 XML? 2. Elem ...

  6. 干货 | Python 标准库之 XML(上)

    本文作者:Rocky0249 公众号:Python空间 写在之前 带分隔符的文件仅有两维的数据:行 & 列.如果我们想在程序之间交换数据结构,需要一种方法把层次结构,序列,集合和其它的数据结构 ...

  7. python xml et_Python 标准库之 XML(下)

    本文字数:3253 字 阅读本文大概需要:9 分钟 写在之前 隔了两天了,不知道你们还记得上一篇文章的内容不,如果不记得的话请移步 -- Python 标准库之 XML(上). 今天我们继续来学习 X ...

  8. python xml etree_python解析xml文件之xml.etree.cElementTree和xml.etree.ElementTree区别和基本使用...

    1.解析速度:ElementTree在 Python 标准库中有两种实现.一种是纯 Python 实现例如 xml.etree.ElementTree ,另外一种是速度快一点的 xml.etree.c ...

  9. python 打印xml文档树_[Python]xml.etree.ElementTree处理xml文档

    需求: 在实际应用中,需要对xml配置文件进行实时修改, 1.增加.删除 某些节点 2.增加,删除,修改某个节点下的某些属性 3.增加,删除,修改某些节点的文本 xml源文件格式[例] path=&q ...

最新文章

  1. 学界 | 进化算法可以不再需要计算集群,开普敦大学的新方法用一块GPU也能刷新MNIST记录
  2. MATLAB学习笔记(一)——入门与操作
  3. 软件技术支持职责和能力要求(偏软件方向)
  4. mybatis select语句会默认带排序吗_10月阿里最新38道Java面试题解析(MyBatis+消息队列+Redis)...
  5. gentoo hibernate
  6. jar注册成服务器,Spring Boot项目生成jar包,并在windows服务器中注册成服务,开机启动(示例代码)...
  7. linux 日志按大小切割_linux下nohup日志切割方案
  8. 必读!Java开发人员的十大戒律
  9. 利用OneNET实现SIM868使用HTTP协议给服务器发送数据并显示
  10. 坚果种类和营养价值排名
  11. python display方法_python学习之Display
  12. 俄罗斯无线认证-FAC认证
  13. 深信服技术认证之F5隐写工具初探
  14. 吴乙己的数仓指南_2维度建模核心思想
  15. 讯时后台编辑器在IE8下无法打开窗口的解决办法
  16. 使用粒子效果动画组成模型[自定义shader实现]
  17. hover父元素,不希望子元素消失(子元素盒子在下方展开,但鼠标移到子元素时盒子却消失了)
  18. inet_aton和inet_ntoa
  19. OSCHina技术导向:Java开源QQ工具iQQ
  20. A/libc:fatal signal 11(SIGSEGV).code 1, fault addr 0x0 in tid 26488 (VideoEncoder)

热门文章

  1. 幼儿园计算机教案 认识画图,认识神奇画图板教案
  2. 微信小程序模仿快播标签云滚动特效
  3. 关于罗技外置摄像头配置
  4. oracle19c的版本号_Oracle Database 20c/19c/18c/12c发布的新特性介绍
  5. Algorithms for Recovery and Isolation Exploiting Semantics
  6. 试一下JAVAMAIL
  7. 这些比较前沿的设计网站,你知道吗?
  8. Java编程语言学习:Java语言基础案例(如求两门课分数之差、三门课平均分、关系运算符作比较)之详细攻略
  9. GDB抓虫之旅(上篇)
  10. 浙江大学计算机电子信息,浙江大学