本文整理汇总了C#中System.Uri.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# System.Uri.ToString方法的具体用法?C# System.Uri.ToString怎么用?C# System.Uri.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Uri
的用法示例。
在下文中一共展示了System.Uri.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constructor_BaseUrlReturnsCorrectValue
public void Constructor_BaseUrlReturnsCorrectValue()
{
System.Uri baseUri = new System.Uri("http://www.google.com");
IUrlService service = new DefaultUrlService(baseUri, null);
Assert.AreEqual(baseUri.ToString(), service.BaseUrl, @"
The BaseUrl property should return the value of the uri that was passed to the constructor.
");
}
示例2: StartDownloadAsync
public IAsyncOperationWithProgress<DownloadOperation, DownloadOperation> StartDownloadAsync(Uri uri, IStorageFile storageFile)
{
StartedDownloadingWithUrl = uri.ToString();
return AsyncInfo.Run<DownloadOperation, DownloadOperation>((ctx, progress) => Task.Run<DownloadOperation>(() => (DownloadOperation)null));
}
示例3: btnDonate_Click
private void btnDonate_Click(object sender, System.Windows.RoutedEventArgs e)
{
var uri = new System.Uri(@"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=Nchek2000%40gmail%2ecom&lc=US&item_name=NijieDownloader¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted");
Process.Start(new ProcessStartInfo(uri.ToString()));
e.Handled = true;
}
示例4: GetUrl_NullPath
public void GetUrl_NullPath()
{
System.Uri baseUri = new System.Uri("http://www.google.com");
IUrlService service = new DefaultUrlService(baseUri, null);
Assert.AreEqual(baseUri.ToString(), service.GetUrl(null), @"
The GetUrl method should take in a path and append it to the end of the base Url.
If null is passed for the path, then the base url should be returned.
");
}