共用方式為


DataPackage.SetUri(Uri) 方法

定義

注意

SetUri 可能會在Windows 8.1之後變更或無法使用版本。 請改用 ApplicationLinkWebLink

設定 DataPackage中包含的統一資源識別項 (URI) 。

public:
 virtual void SetUri(Uri ^ value) = SetUri;
/// [Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
void SetUri(Uri const& value);
/// [Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
void SetUri(Uri const& value);
/// [Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD).Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
void SetUri(Uri const& value);
[Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public void SetUri(System.Uri value);
[Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public void SetUri(System.Uri value);
[Windows.Foundation.Metadata.Deprecated("SetUri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD).Instead, use SetWebLink or SetApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public void SetUri(System.Uri value);
function setUri(value)
Public Sub SetUri (value As Uri)

參數

value
Uri Uri

DataPackage中包含的統一資源識別項 (URI) 。

屬性

範例

下列程式碼範例示範應用程式如何在 DataPackage 物件上設定 URI。

public void ShareSourceLoad()
{
    DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
    dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);
}

void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
    DataRequest request = e.Request;
    request.Data.Properties.Title = "Share Link Example";
    request.Data.Properties.Description = "An example of how to share a link.";
    var link = new Uri("http://www.fabrikam.com");
    request.Data.SetUri(link);
}

備註

這個方法會設定 StandardFormats.Uri的值。

統一資源識別元 (URI) 是 DataPackage 物件直接支援的其中一種資料類型。 如需其他支援資料類型的詳細資訊,請參閱 StandardDataFormats 類別。

適用於