共用方式為


DataRequest.FailWithDisplayText(String) 方法

定義

取消共用作業,並提供要向使用者顯示的錯誤字串。

public:
 virtual void FailWithDisplayText(Platform::String ^ value) = FailWithDisplayText;
void FailWithDisplayText(winrt::hstring const& value);
/// [Windows.Foundation.Metadata.Deprecated("FailWithDisplayText is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.Foundation.UniversalApiContract")]
void FailWithDisplayText(winrt::hstring const& value);
public void FailWithDisplayText(string value);
[Windows.Foundation.Metadata.Deprecated("FailWithDisplayText is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.Foundation.UniversalApiContract")]
public void FailWithDisplayText(string value);
function failWithDisplayText(value)
Public Sub FailWithDisplayText (value As String)

參數

value
String

Platform::String

winrt::hstring

要顯示給使用者的文字。

屬性

備註

當您的應用程式無法提供DataPackage給目標應用程式時,請使用FailWithDisplayText方法。 這個方法會取消共用作業,並提供文字訊息給目標應用程式。 然後,目標應用程式可以向使用者顯示此文字,以說明共用作業失敗的原因。

此 API 在 SDK 1511 和 1607 版中標示為已被取代。 不過,此 API 已不再于 1703 年淘汰。 您可以遵循 如何:隱藏編譯器警告 主題中的指示,隱藏 Visual Studio 中的取代警告。

適用於