当前位置: 首页>>代码示例>>C#>>正文


C# Uri.?.ToString方法代码示例

本文整理汇总了C#中System.Uri.?.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Uri.?.ToString方法的具体用法?C# Uri.?.ToString怎么用?C# Uri.?.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Uri的用法示例。


在下文中一共展示了Uri.?.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteNuspec

 public static void WriteNuspec(
     Stream stream,
     bool leaveStreamOpen,
     string id,
     string version,
     string title = "Package Id",
     string summary = "Package Summary",
     string authors = "Package author",
     string owners = "Package owners",
     string description = "Package Description",
     string tags = "Package tags",
     string language = null,
     string copyright = null,
     string releaseNotes = null,
     string minClientVersion = null,
     Uri licenseUrl = null,
     Uri projectUrl = null,
     Uri iconUrl = null,
     bool requireLicenseAcceptance = false,
     IEnumerable<PackageDependencyGroup> packageDependencyGroups = null,
     IEnumerable<NuGet.Packaging.Core.PackageType> packageTypes = null)
 {
     using (var streamWriter = new StreamWriter(stream, new UTF8Encoding(false, true), 1024, leaveStreamOpen))
     {
         streamWriter.WriteLine(@"<?xml version=""1.0""?>
             <package xmlns=""http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"">
                 <metadata" + (!string.IsNullOrEmpty(minClientVersion) ? @" minClientVersion=""" + minClientVersion + @"""" : string.Empty) + @">
                     <id>" + id + @"</id>
                     <version>" + version + @"</version>
                     <title>" + title + @"</title>
                     <summary>" + summary + @"</summary>
                     <description>" + description + @"</description>
                     <tags>" + tags + @"</tags>
                     <requireLicenseAcceptance>" + requireLicenseAcceptance + @"</requireLicenseAcceptance>
                     <authors>" + authors + @"</authors>
                     <owners>" + owners + @"</owners>
                     <language>" + (language ?? string.Empty) + @"</language>
                     <copyright>" + (copyright ?? string.Empty) + @"</copyright>
                     <releaseNotes>" + (releaseNotes ?? string.Empty) + @"</releaseNotes>
                     <licenseUrl>" + (licenseUrl?.ToString() ?? string.Empty) + @"</licenseUrl>
                     <projectUrl>" + (projectUrl?.ToString() ?? string.Empty) + @"</projectUrl>
                     <iconUrl>" + (iconUrl?.ToString() ?? string.Empty) + @"</iconUrl>
                     <packageTypes>" + WritePackageTypes(packageTypes) + @"</packageTypes>
                     <dependencies>" + WriteDependencies(packageDependencyGroups) + @"</dependencies>
                 </metadata>
             </package>");
     }
 }
开发者ID:rhysawilliams2010,项目名称:NuGetGallery,代码行数:48,代码来源:TestPackage.cs

示例2: sendFormFillerTemplates

 public DocumentResponse sendFormFillerTemplates(List<FormFillerTemplate> templates, DateTime dueDate, bool embedded = false, Uri returnUrl = null)
 {
     var result = _client.Post(new SendFormFillerRequest
     {
         Templates = templates,
         DueDate = dueDate.ToUniversalTime().ToString("o"),
         GMT = this.GMT,
         Embedded = embedded,
         ReturnUrl = returnUrl?.ToString()
     });
     return result;
 }
开发者ID:SecuredSigning,项目名称:.NET-Client-SDK,代码行数:12,代码来源:ServiceClient.cs

示例3: sendSmartTagDocument

        /// <summary>
        /// <see cref="http://www.securedsigning.com/documentation/developer/smarttag-api#adv3"/>
        /// </summary>
        /// <param name="documentReferences"></param>
        /// <param name="dueDate"></param>
        /// <param name="signers"></param>
        /// <param name="embedded"></param>
        /// <param name="returnUrl"></param>
        /// <returns></returns>
        public List<Document> sendSmartTagDocument(List<string> documentReferences, DateTime dueDate, SmartTagInvitee[] signers, bool embedded, Uri returnUrl)
        {
            var result = _client.Post<List<Document>>(new SmartTagRequest
            {
                DocumentReferences = documentReferences,
                DueDate = dueDate.ToUniversalTime().ToString("o"),
                GMT = this.GMT,
                Embedded = embedded,
                ReturnUrl = returnUrl?.ToString(),
                Signers = signers.ToList()
            });

            return result;
        }
开发者ID:SecuredSigning,项目名称:.NET-Client-SDK,代码行数:23,代码来源:ServiceClient.cs

示例4: RestResponse

 public RestResponse(EntityTagHeaderValue eTag, Uri location, string content)
 {
     ETag = eTag?.Tag ?? String.Empty;
     Location = location?.ToString() ?? String.Empty;
     Content = content;
 }
开发者ID:microServiceBus,项目名称:Orchestrate-.NET-SDK,代码行数:6,代码来源:RestResponse.cs

示例5: DeregisterLink

		public async void DeregisterLink(Uri uri)
		{
			if (string.IsNullOrWhiteSpace(uri?.ToString()))
				throw new ArgumentNullException(nameof(uri));
			await RemoveLinkAsync(uri.ToString());
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:6,代码来源:iOSAppLinks.cs

示例6: LogAdditionalUserInfo

 private static void LogAdditionalUserInfo(int guestID, UtmParamWrapper utm, Uri urlReferrer, Uri url, HttpBrowserCapabilitiesBase httpBrowserCapabilitiesBase, string userAgent)
 {
     TaskRunner.Instance.AddAction(() => {
         BusinessLogic.UserProvider.SaveReferrer(guestID, urlReferrer?.ToString() ?? string.Empty, url?.ToString() ?? string.Empty);
         BusinessLogic.UserProvider.SaveUtm(guestID, utm);
         var browserInfo = new BrowserInfo(httpBrowserCapabilitiesBase, userAgent);
         BusinessLogic.UserProvider.SaveTechInfo(guestID, new GuestTechInfoTransport {
             Version = browserInfo.CurrentVersion(),
             BrowserType = browserInfo.Name,
             Os = browserInfo.Os,
             IsMobile = browserInfo.Mobile,
             UserAgent = browserInfo.UserAgent
         });
     });
 }
开发者ID:dnmsk,项目名称:rProject,代码行数:15,代码来源:ApplicationControllerBase.cs

示例7: SetConfigurationAsync

		/// <summary>
		/// Sets the configuration asynchronous.
		/// </summary>
		/// <param name="serverUri">The server URI.</param>
		/// <param name="username">The username.</param>
		/// <param name="password">The password.</param>
		/// <returns></returns>
		/// <exception cref="System.ArgumentNullException">
		/// </exception>
		public async Task<bool> SetConfigurationAsync(Uri serverUri, String username, String password)
		{
			if(serverUri == null)
			{
				throw new ArgumentNullException(nameof(serverUri));
			}

			if(username == null)
			{
				throw new ArgumentNullException(nameof(username));
			}

			if(password == null)
			{
				throw new ArgumentNullException(nameof(password));
			}

			var valueSet = new ValueSet();
			valueSet["Action"] = "SetConfiguration";
			valueSet["ServerUri"] = serverUri?.ToString();
			valueSet["Username"] = username;
			valueSet["Password"] = password;

			var result = await connection.SendMessageAsync(valueSet);
			if(result.Status == AppServiceResponseStatus.Success)
			{
				var status = result.Message.GetValue<bool?>("Status");
				if(status == true)
				{
					return true;
				}
				return false;
			}
			else
			{
				return false;
			}
		}
开发者ID:holtsoftware,项目名称:House,代码行数:47,代码来源:ThermostatManager.cs


注:本文中的System.Uri.?.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。