本文整理汇总了C#中StringBuilder.AppendNewLine方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.AppendNewLine方法的具体用法?C# StringBuilder.AppendNewLine怎么用?C# StringBuilder.AppendNewLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.AppendNewLine方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString
/// <summary>
/// Returns the normalized representation of the timestamp data.
/// </summary>
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.AppendNewLine(PREAMBLE)
.AppendNewLine(fresh.ToString());
return builder.ToString();
}
示例2: ToString
/// <summary>
/// Returns the normalized representation of the timestamp data.
/// </summary>
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.AppendNewLine(PREAMBLE)
.AppendNewLine(fresh.ToString());
string normalizedTimestamp = builder.ToString();
HawkEventSource.Log.NormalizedTimestamp(normalizedTimestamp);
return normalizedTimestamp;
}
示例3: ToBytes
/// <summary>
/// Returns the normalized payload bytes.
/// </summary>
internal byte[] ToBytes()
{
if (this.body != null)
{
StringBuilder builder = new StringBuilder();
builder
.AppendNewLine(PREAMBLE)
.AppendNewLine(contentType == null ? String.Empty : contentType.ToLower())
.AppendNewLine(this.body);
return builder.ToString().ToBytesFromUtf8();
}
return null;
}
示例4: ToString
/// <summary>
/// Returns the normalized request string.
/// </summary>
public override string ToString()
{
StringBuilder result = new StringBuilder();
result
.AppendNewLine(this.IsBewit ? BEWIT_PREAMBLE : REQUEST_PREAMBLE)
.AppendNewLine(artifacts.Timestamp.ToString())
.AppendNewLine(artifacts.Nonce)
.AppendNewLine(this.method)
.AppendNewLine(this.path)
.AppendNewLine(this.hostName)
.AppendNewLine(this.port)
.AppendNewLine(artifacts.PayloadHash == null ? null : artifacts.PayloadHash.ToBase64String())
.AppendNewLine(artifacts.ApplicationSpecificData);
return result.ToString();
}
示例5: ToString
/// <summary>
/// Returns the normalized request string.
/// </summary>
public override string ToString()
{
StringBuilder result = new StringBuilder();
result
.AppendNewLine(this.GetPreamble())
.AppendNewLine(artifacts.Timestamp.ToString())
.AppendNewLine(artifacts.Nonce)
.AppendNewLine(this.method)
.AppendNewLine(this.path)
.AppendNewLine(this.hostName)
.AppendNewLine(this.port)
.AppendNewLine(artifacts.PayloadHash == null ? null : artifacts.PayloadHash.ToBase64String())
.AppendNewLine(artifacts.ApplicationSpecificData);
string normalizedRequest = result.ToString();
HawkEventSource.Log.NormalizedRequest(normalizedRequest);
return normalizedRequest;
}
示例6: ToBytes
/// <summary>
/// Returns the normalized payload bytes.
/// </summary>
internal byte[] ToBytes()
{
if (this.body != null)
{
StringBuilder builder = new StringBuilder();
builder
.AppendNewLine(PREAMBLE)
.AppendNewLine(contentType == null ? String.Empty : contentType.ToLower())
.AppendNewLine(this.body);
string normalizedPayload = builder.ToString();
HawkEventSource.Log.NormalizedBody(normalizedPayload);
return normalizedPayload.ToBytesFromUtf8();
}
HawkEventSource.Log.NormalizedBody("null");
return null;
}
示例7: ToBytesAsync
/// <summary>
/// Returns the normalized payload bytes.
/// </summary>
internal async Task<byte[]> ToBytesAsync()
{
if (this.content != null)
{
string contentType = String.Empty;
if (content.Headers.ContentType != null)
{
contentType = content.Headers.ContentType.MediaType.ToLower();
}
string body = await content.ReadAsStringAsync();
StringBuilder builder = new StringBuilder();
builder
.AppendNewLine(PREAMBLE)
.AppendNewLine(contentType)
.AppendNewLine(body ?? String.Empty);
return builder.ToString().ToBytesFromUtf8();
}
return null;
}
示例8: Address
public string Address()
{
var sb = new StringBuilder();
sb.AppendNewLine(AddressLineOne);
sb.AppendNewLine(AddressLineTwo);
var csz = Util.FormatCSZ(City, State, ZipCode);
sb.AppendNewLine(csz);
return sb.ToString();
}