本文整理汇总了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>");
}
}
示例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;
}
示例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;
}
示例4: RestResponse
public RestResponse(EntityTagHeaderValue eTag, Uri location, string content)
{
ETag = eTag?.Tag ?? String.Empty;
Location = location?.ToString() ?? String.Empty;
Content = content;
}
示例5: DeregisterLink
public async void DeregisterLink(Uri uri)
{
if (string.IsNullOrWhiteSpace(uri?.ToString()))
throw new ArgumentNullException(nameof(uri));
await RemoveLinkAsync(uri.ToString());
}
示例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
});
});
}
示例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;
}
}