Package.Launch(String) 方法

定義

僅 Windows Phone。 啟動指定的應用程式。

public:
 virtual void Launch(Platform::String ^ parameters) = Launch;
/// [Windows.Foundation.Metadata.Deprecated("Launch may be altered or unavailable for releases after Windows 8.1. Instead, for SmartCardTrigger scenarios use SmartCardTriggerDetails.TryLaunchSelfAsync", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
void Launch(winrt::hstring const& parameters);
/// [Windows.Foundation.Metadata.Deprecated("Launch may be altered or unavailable for releases after Windows 8.1. Instead, for SmartCardTrigger scenarios use SmartCardTriggerDetails.TryLaunchSelfAsync", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
void Launch(winrt::hstring const& parameters);
[Windows.Foundation.Metadata.Deprecated("Launch may be altered or unavailable for releases after Windows 8.1. Instead, for SmartCardTrigger scenarios use SmartCardTriggerDetails.TryLaunchSelfAsync", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public void Launch(string parameters);
[Windows.Foundation.Metadata.Deprecated("Launch may be altered or unavailable for releases after Windows 8.1. Instead, for SmartCardTrigger scenarios use SmartCardTriggerDetails.TryLaunchSelfAsync", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public void Launch(string parameters);
function launch(parameters)
Public Sub Launch (parameters As String)

參數

parameters
String

Platform::String

winrt::hstring

導覽 URI,指定要啟動的頁面和選擇性參數。 使用空字串來指定應用程式的預設頁面。

屬性

備註

Launch 參數的格式與 NavigationUri 格式相同。 下表提供一些範例:

案例Launch 參數範例
您只想使用預設頁面啟動應用程式。指定空字串。'pkg.啟動 (“”) ;'
您要啟動至特定的 XAML 頁面。以正斜線開頭 (/) 後面接著 XAML 頁面名稱。'pkg.啟動 (“/Page1.xaml”) ;'
您想要將參數傳遞至預設頁面。以問號開頭 (?) 後面接著名稱/值組。 使用名稱與值之間的等號 (=) 。 將多個名稱/值組與連字元 (& 分隔) 。'pkg.launch (“?content=1234¶m2=test”) ;'
您想要啟動至特定的 XAML 頁面,並傳入參數。使用前兩個範例的組合。'pkg.啟動 (“/Page1.xaml?content=1234¶m2=test ”) ;'

重要

只有在從 Windows Phone Silverlight 應用程式呼叫 Launch 方法時才有效。

適用於