windows phone 8 新增功能:從一個應用程式啟動另一個程式(file association 和 Protocol association兩種方式)
一. 啟動手機預裝內建程式開啟檔案
file association
這裡以開啟word文件為例子
- string fileToLaunch = @"HelloKitty.docx";
- // Launch a .docx file that came with the package.
- private async void LaunchFileButton_Click(object sender, RoutedEventArgs e)
- {
- // First, get the word file from the package's doc directory.
-
IStorageFolder applicationFolder = ApplicationData.Current.LocalFolder;
IStorageFile storageFile = await applicationFolder.GetFileAsync(fileToLaunch); - // Next, launch the file.
- bool success = await Windows.System.Launcher.LaunchFileAsync(file);
- if (success)
- {
- }
- else
- {
- }
- }
二. 啟動手機已安裝第三方程式 Protocol association
a. 首先定義一個遵守Protocol association協議的第三方程式
Protocol association需要在WPAppManifest.xaml註冊;
要註冊Protocol assocation,必須用XML (Text) Editor開啟WPAppManifest.xaml;
必須在</Token>後面新增類似如下程式碼:
<Extensions> <Protocol Name="mkv" NavUriFragment="encodedLaunchUri=%s" TaskID="_default" /></Extensions>
b. 啟動支援mkv協議的第三方程式
Windows.System.Launcher.LaunchUriAsync(new Uri("mkv:HelloKitty"));
三 Windows Phone8系統保留的關聯URI, 注意:關鍵詞前的“ :”
- bing:[keyword] 開啟bing並按照關鍵詞搜尋
- callto:
- dtmf:
- http:[url] 在瀏覽器中開啟指定URL
- https:[url] 在瀏覽器中開啟指定URL
- maps:
- mailto:[Email] 開啟郵件介面,給指定聯絡人傳送郵件
- ms-excel:
- ms-powerpoint:
- ms-settings-accounts:
- ms-settings-airplanemode: 開啟飛航模式設定開關
- ms-settings-bluetooth: 開啟藍芽設定開關
- ms-settings-cellular: 開啟手機網路設定開關
- ms-settings-emailandaccounts: 開啟電子郵件+賬戶設定開關
- ms-settings-location: 開啟定位設定開關
- ms-settings-lock: 開啟鎖屏設定開關
- ms-settings-wifi: 開啟wifi設定開關
- ms-word:
- office:
- onenote:
- tel:[phone number] 開啟撥號介面呼叫電話,對於省略電話號碼,如果當前處於通話中可以直接進入撥號介面.
- wallet:
- xbls:
- zune:navigate?appid=[app ID] 開啟Windows Phone商店,並顯示指定的應用程式的詳細資訊頁面。
- zune:reviewapp
- zune:reviewapp?appid=[app ID] 開啟Windows Phone商店,並顯示指定的應用程式的打分並評論頁面。
- zune:search?keyword=[search keyword]&publisher=[publisher name]&contenttype=app
- 開啟Windows Phone商店,並按設定的關鍵詞搜尋應用程式。注意這裡的所有的引數都是可選的,支援中英文關鍵詞。
四:系統支援的內建檔案型別 以及系統 保留型別參考 MSDN Reserved file and URI associations for Windows Phone 8
相關文章
- SAP SEGW 事物碼裡的 Association 建模方式
- laravel schedule run 任務排程在 Windows下的另一種啟動方式LaravelWindows
- mybatis collection解析以及和association的區別MyBatis
- 如何用ABAP程式碼讀取CDS view association的資料View
- Win10電腦把應用程式從一個桌面移到另一桌面的方法Win10
- Inner Join, Left Outer Join和Association的區別
- 服務啟動一個程式
- 另一個Swoole偵錯程式 - Yasd
- 兩天擼一個天氣應用微信小程式微信小程式
- 第一個 Angular 應用程式Angular
- 在 Mac 上執行 Windows 應用程式,只需一個CrossOver!MacWindowsROS
- IIS同一站點下發布兩個或多個net8、net core應用程式池
- python中怎麼呼叫另一個程式Python
- 【Azure 應用服務】一個 App Service 同時部署執行兩個及多個 Java 應用程式(Jar包)APPJavaJAR
- 樹的另一個構建方式
- SAP ABAP CDS view 裡 INNER JOIN 和 Association 的區別View
- 一步步學習 SAP CDS view Text Association 在 SAP Fiori Elements 中的應用View
- SAP UI5 ManagedObject 的 Association 講解UIObject
- SAP ABAP CDS view Association 引入的緣由View
- 從鍵盤上開啟 Mac 應用程式的 4 種方法Mac
- [part 1] 第一個 Django 應用程式Django
- 我的第一個Android應用程式Android
- framework——應用程式啟動流程Framework
- Swoole 啟動一個服務,開啟了哪些程式和執行緒?執行緒
- Linux程式間通訊有幾種方式?這8個你都知道嗎?Linux
- Windows從命令列建立文字檔案的兩種方式Windows命令列
- 從0到1使用Kubernetes系列(四):搭建第一個應用程式
- iOS App中可拆卸一個framework的兩種方式iOSAPPFramework
- Windows Phone應用效能監控與分析技巧Windows
- 搭建一個攝像頭應用程式 應用程式內部攝像頭
- [原創]兩個樣本分析,兩種程式注入學習
- 動圖之一個圓繞另一個圓轉動
- 使用docker compose一鍵啟動多個應用Docker
- 使用 Docker 和 Elasticsearch 構建一個全文搜尋應用程式DockerElasticsearch
- 2.2. 第一個應用,遇到 no input file specified
- windows10系統設定和使用Your Phone應用的方法Windows
- SAP CRM Fiori應用如何啟用Sales Office和Sales Group兩個欄位
- Windows Phone SDK 8/8.1 官方下載Windows
- 兩種方式lu一個vue彈窗元件(v-model與promise方式)Vue元件Promise