StandardDataFormats.Uri 屬性

定義

注意

在Windows 8.1之後,可能會變更或無法使用 URI。 請改用 ApplicationLinkWebLink

唯讀屬性,會傳回對應至統一資源識別項 (URI) 格式的格式識別碼字串值。

public:
 static property Platform::String ^ Uri { Platform::String ^ get(); };
/// [get: Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
static winrt::hstring Uri();
/// [get: Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
static winrt::hstring Uri();
public static string Uri { [Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; }
public static string Uri { [Windows.Foundation.Metadata.Deprecated("Uri may be altered or unavailable for releases after Windows Phone 'OSVersion' (TBD). Instead, use WebLink or ApplicationLink.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; }
var string = StandardDataFormats.uri;
Public Shared ReadOnly Property Uri As String

屬性值

String

Platform::String

winrt::hstring

對應至統一資源識別項 (URI 格式) 格式的格式識別碼字串值。

屬性

範例

此範例示範如何使用 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);
}

適用於