1. Start the phone to pre-install the built-in program to open the file association
Here is an example of opening a Word document.
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.
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(fileToLaunch);
// Next, launch the file.
bool success = await Windows.System.Launcher.LaunchFileAsync(file);
if (success)
{
}
else
{
}
}
2. Start the mobile phone and install the third-party program protocol Association.
A. First define a third-party program that complies with the Protocol Association Protocol
Protocol association needs to be registered in wpappmanifest. XAML;
To register protocol assocation, you must use the XML (text) editor to open wpappmanifest. XAML;
The following code must be added after </token>:
<Extensions> <protocol name = "MKV" navurifragment = "encodedlaunchuri = % s" taskid = "_ default"/> </extensions>
B. Start third-party programs that support the MKV Protocol
Windows. system. launcher. launchurchill iasync (New uri ("MKV: hellokitty "));
The associated URI retained by Windows phone8,Note: ":" Before the keyword
bing: [keyword] Open bing and search by keywords
callto:
dtmf:
http: [url] Open the specified URL in a browser
https: [url] Open the specified URL in a browser
maps:
mailto: [Email] Open the mail interface and send mail to the specified contact
ms-excel:
ms-powerpoint:
ms-settings-accounts:
ms-settings-airplanemode: Turn on the flight mode settings switch
ms-settings-bluetooth: turn on the Bluetooth settings switch
ms-settings-cellular: Turn on network settings for mobile phones
ms-settings-emailandaccounts: turn on email + account settings
ms-settings-location: turn on the location settings switch
ms-settings-lock: Turn on the lock screen settings switch
ms-settings-wifi: turn on the wifi settings switch
ms-word:
office:
onenote:
tel: [phone number] Open the dial interface to call the phone. For the omitted phone number, you can directly enter the dial interface if you are currently in a call.
wallet:
xbls:
zune: navigate? appid = [app ID] Opens the Windows Phone store and displays the details page for the specified application.
zune: reviewapp
zune: reviewapp? appid = [app ID] Opens the Windows Phone Store and displays the rating and review page for the specified application.
zune: search? keyword = [search keyword] & publisher = [publisher name] & contenttype = app
Open the Windows Phone store and search for applications by the keywords you set. Note that all parameters here are optional and support Chinese and English keywords.
4. For the built-in file types and retention types supported by the system, refer to msdn
Reserved file and Uri associations for Windows Phone 8