本文整理汇总了C#中System.Text.StringBuilder.AppendLine方法的典型用法代码示例。如果您正苦于以下问题:C# System.Text.StringBuilder.AppendLine方法的具体用法?C# System.Text.StringBuilder.AppendLine怎么用?C# System.Text.StringBuilder.AppendLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了System.Text.StringBuilder.AppendLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString
public override string ToString()
{
var sb = new System.Text.StringBuilder();
sb.AppendLine(string.Format("{0}: {1}", "X", X));
sb.AppendLine(string.Format("{0}: {1}", "Y", Y));
return sb.ToString();
}
示例2: FlowList
public ActionResult FlowList(int? PageIndex, int? PageSize, Int64? qDepotID, long? qProductID, DateTime? qCreateDateStart, DateTime? qCreateDateEnd, int? orderCol)
{
if ((_crud & Zippy.SaaS.Entity.CRUD.Read) != Zippy.SaaS.Entity.CRUD.Read) return RedirectToAction("NoPermission", "Error");
System.Text.StringBuilder sbMenu = new System.Text.StringBuilder();
if ((_crud & Zippy.SaaS.Entity.CRUD.Read) == Zippy.SaaS.Entity.CRUD.Read)
sbMenu.AppendLine("<a href='javascript:;' class='btn list img' id='search'><i class='icon i_search'></i>查询<b></b></a>");
sbMenu.AppendLine("<a href='javascript:;' class='btn img' id='bReload'><i class='icon i_refresh'></i>刷新<b></b></a>");
ViewData["TopMenu"] = sbMenu.ToString();
ViewData.Add("db", db);
ViewData.Add("PageSize", PageSize ?? 10);
int currentPageSize = PageSize ?? 10;
int currentPageIndex = PageIndex ?? 1;
Hashtable hs = new Hashtable();
hs.Add("qDepotID", qDepotID);
hs.Add("qProductID", qProductID);
hs.Add("qCreateDateStart", qCreateDateStart);
hs.Add("qCreateDateEnd", qCreateDateEnd);
PaginatedList<EAP.Logic.Z10.View.V_DepotFlow> result = Z10DepotFlowHelper.Query(db, _tenant.TenantID.Value, currentPageSize, currentPageIndex, hs, orderCol);
result.QueryParameters = hs;
ViewData["DepotOptions"] = EAP.Logic.Z10.HtmlHelper.DepotSelectOptions(_tenant.TenantID.Value, db);
return View(result);
}
示例3: GetText
//=========================================================================================
internal string GetText(TextPoint start, TextPoint end)
{
if (start > end)
{
TextPoint temp = start;
start = end;
end = temp;
}
if (start.Line == end.Line)
return this.Lines[start.Line].Text.Substring(start.Char, end.Char - start.Char);
else
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string sLine = this.Lines[start.Line].Text;
sb.AppendLine(sLine.Substring(start.Char, sLine.Length - start.Char));
for (int i = start.Line + 1; i < end.Line; i++)
sb.AppendLine(this.Lines[i].Text);
sb.AppendLine(this.Lines[end.Line].Text.Substring(0, end.Char));
return sb.ToString();
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
intSite = Convert.ToInt32(HttpContext.Current.Session["SiteId"].ToString());
DataSet data = new DataSet();
data = adds.Get_SideAdds(intSite);//product.Get_SideFeaturedProducts(intSite, intCont, intSubjId);
System.Text.StringBuilder sbproduct = new System.Text.StringBuilder();
int contDiv = 0;
foreach (DataTable table in data.Tables)
{
foreach (DataRow row in table.Rows)
{
if (contDiv == 0)
{
sbproduct.AppendLine("<a href=\"generic_x?LandingId=" + row["AddsLink"] + "\"><div class=\"pubMeetOut\"><img src=\"images\\" + row["AddsImage"] + "\"/> </div></a>");
}
else
{
sbproduct.AppendLine("<a href=\"generic_x?LandingId=" + row["AddsLink"] + "\"><div class=\"pubNeedHelp\"><img src=\"images\\" + row["AddsImage"] + "\"/> </div></a>");
}
contDiv++;
}
}
if (contDiv != 0)
{
Product1.Controls.Add(new LiteralControl(sbproduct.ToString()));
div_Wrapper.Visible = true;
}
}
示例5: CheckSyntax
public static string CheckSyntax(string script, out string stdout)
{
stdout = null;
if (script.StartsWith("#fommScript")) return "Cannot syntax check a fomm script";
string[] errors = null;
string[] warnings = null;
Compile(script, out errors, out warnings, out stdout);
if (errors != null || warnings != null)
{
StringBuilder sb = new StringBuilder();
if (errors != null)
{
sb.AppendLine("Errors:");
for (int i = 0; i < errors.Length; i++) sb.AppendLine(errors[i]);
}
if (warnings != null)
{
sb.AppendLine("Warnings:");
for (int i = 0; i < warnings.Length; i++) sb.AppendLine(warnings[i]);
}
return sb.ToString();
}
return null;
}
示例6: Application_Error
/// <summary>
/// Handles the Error event of the Application control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected void Application_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex is System.Threading.ThreadAbortException)
return;
ex.ExceptionValueTracker(new Dictionary<string, object>() {
{"Is AJAX Request",HttpContext.Current.Request.IsAjaxRequest().ToString()},
{"Request URL",HttpContext.Current.Request.Url},
{"Request Type", HttpContext.Current.Request.HttpMethod},
{"Request Context", HttpContext.Current.Request.Form}
});
if (!HttpContext.Current.Request.IsAjaxRequest())
{
HttpContext.Current.Response.Redirect(string.Format("{0}/Error/Index?msg={1}",
ConfigurationManager.AppSettings["VirtualDirectory"].ToString(), ex.Message));
}
else
{
HttpContext.Current.Response.StatusCode = 500;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.AppendLine(string.Format("Error Source: {0}", ex.InnerException.Source));
sb.AppendLine(string.Format("Error Message: {0}", ex.InnerException.Message));
sb.AppendLine(string.Format("Error Stack: {0}", ex.InnerException.StackTrace));
HttpContext.Current.Response.Write(sb.ToString());
}
}
示例7: TestSuite
/// <summary>
/// Creates a new TestSuite instance.
/// </summary>
/// <param name="openFile"> A callback that can open a file for reading. </param>
public TestSuite(Func<string, Stream> openFile)
{
if (openFile == null)
throw new ArgumentNullException("openFile");
// Init collection.
this.IncludedTests = new List<string>();
// Open the excludelist.xml file to generate a list of skipped file names.
var reader = System.Xml.XmlReader.Create(openFile(@"config\excludeList.xml"));
reader.ReadStartElement("excludeList");
do
{
if (reader.Depth == 1 && reader.NodeType == System.Xml.XmlNodeType.Element && reader.Name == "test")
this.skippedTestNames.Add(reader.GetAttribute("id"));
} while (reader.Read());
// Read the include files.
var includeBuilder = new System.Text.StringBuilder();
includeBuilder.AppendLine(ReadInclude(openFile, "cth.js"));
includeBuilder.AppendLine(ReadInclude(openFile, "sta.js"));
includeBuilder.AppendLine(ReadInclude(openFile, "ed.js"));
this.includes = includeBuilder.ToString();
this.zipStream = openFile(@"suite\2012-05-18.zip");
this.zipFile = new ZipFile(this.zipStream);
this.ApproximateTotalTestCount = (int)this.zipFile.Count;
}
示例8: Render
protected override void Render(HtmlTextWriter writer)
{
var node = this.Provider.CurrentNode;
var nodes = new Stack<SiteMapNode>();
for (var currentNode = node; currentNode != null; currentNode = currentNode.ParentNode)
{
nodes.Push(currentNode);
}
var sb = new System.Text.StringBuilder();
sb.AppendLine(@"<ul class=""breadcrumb"" " + this.CssClass + ">");
foreach (var currentNode in nodes)
{
var siteMapNode = this.Provider.CurrentNode;
if (siteMapNode != null && currentNode.Url == siteMapNode.Url)
{
sb.AppendLine(@"<li class=""active"">" + currentNode.Title + "</li>");
}
else
{
if (currentNode != null)
if (currentNode.ParentNode == null)
sb.AppendLine(@"<li><i class='fa fa-home'></i><a href=""" + currentNode.Url + @""">" + currentNode.Title + "</a></li>");
else
sb.AppendLine(@"<li><a href=""" + currentNode.Url + @""">" + currentNode.Title + "</a></li>");
}
}
sb.AppendLine(@"</ul>");
if (writer != null) writer.Write(sb.ToString());
}
示例9: sendButton_Click
protected void sendButton_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
string subject = string.Format("ezLooker: {0}", this.emailInput.Text);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.AppendLine();
sb.AppendFormat("IP: {0}", Request.UserHostAddress).AppendLine();
sb.AppendFormat("UserAgent: {0}", Request.UserAgent).AppendLine();
sb.AppendFormat("Name: {0}", this.nameInput.Text).AppendLine();
sb.AppendFormat("Email: {0}", this.emailInput.Text).AppendLine();
sb.AppendLine("Comment:");
sb.AppendFormat("{0}", this.commentInput.Text).AppendLine();
try
{
using (MailMessage mailMessage = new MailMessage("[email protected]", "[email protected]", subject, sb.ToString()))
{
using (SmtpClient smtpClient = new SmtpClient() { Host = "smtp.gmail.com", Credentials = new NetworkCredential("[email protected]", "ihateHTML!"), EnableSsl = true })
{
smtpClient.Send(mailMessage);
}
}
}
catch
{
// TODO: Log Exeption
}
this.contact.ActiveViewIndex = 1;
}
示例10: GetTimeCardInfo
/// <summary>
/// タイムカード情報を取得
/// </summary>
/// <param name="data"></param>
public int GetTimeCardInfo(System.Data.DataSet data)
{
System.Text.StringBuilder sqlbldr = new System.Text.StringBuilder();
sqlbldr.AppendLine("select ");
sqlbldr.AppendLine(" t1.timecard_id ");
sqlbldr.AppendLine(" ,t1.clock_in_time ");
sqlbldr.AppendLine(" ,t1.clock_out_time ");
sqlbldr.AppendLine("from eip_t_ext_timecard t1");
sqlbldr.AppendLine("where 1 = 1");
sqlbldr.AppendLine("and t1.user_id = :user_id");
sqlbldr.AppendLine("and t1.punch_date = to_date(:punch_date, 'YYYY-MM-DD')");
ExtTimeCardDataSet.search_eip_t_ext_timecardRow param = ((ExtTimeCardDataSet)data).search_eip_t_ext_timecard[0];
ArrayList paramList = new ArrayList();
if (!String.IsNullOrEmpty(param.user_id))
{
paramList.Add(DBUtility.MakeParameter("user_id", param.user_id, NpgsqlDbType.Integer));
}
if (!String.IsNullOrEmpty(param.punch_date))
{
paramList.Add(DBUtility.MakeParameter("punch_date", param.punch_date, NpgsqlDbType.Varchar));
}
return this.dbHelper.Select(((ExtTimeCardDataSet)data).eip_t_ext_timecard, sqlbldr.ToString(), paramList);
}
示例11: WriteDescriptionTo
public override void WriteDescriptionTo(NUnitCtr.MessageWriter writer)
{
var sb = new System.Text.StringBuilder();
sb.AppendLine();
sb.AppendFormat("Successful execution of the etl.");
sb.AppendLine();
writer.WritePredicate(sb.ToString());
}
示例12: Summary
public void Summary(Exception ex, string ExtraInfo = null)
{
System.Text.StringBuilder message = new System.Text.StringBuilder();
if (ExtraInfo != null) message.AppendLine(ExtraInfo + Environment.NewLine);
message.AppendLine(ex.Description() + Environment.NewLine);
if (this.Log != null) this.Log.Out(message.ToString(), Dumpster2.Logger.TextFormat.Box);
var df = new frmError(ex.GetType().Name, message.ToString());
}
示例13: Render
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
try
{
if (this.ListToDisplay != null)
{
SPList selectedList = SPContext.Current.Web.Lists[new Guid(this._listToDisplay)];
SPView defaultView = selectedList.DefaultView;
if (this.IsExternalList)
{
SPViewFieldCollection fields = defaultView.ViewFields;
System.Collections.Specialized.StringCollection stringCol = fields.ToStringCollection();
// Nik20121105 - Write the table headers;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.AppendLine("<table class=\"wet-boew-zebra\">");
sb.Append("<tr>");
foreach (string field in stringCol)
{
sb.Append("<th>" + field + "</th>");
}
sb.Append("</tr>");
foreach (SPListItem item in selectedList.Items)
{
sb.AppendLine("<tr>");
bool firstCol = true;
foreach (string field in stringCol)
{
if (firstCol)
{
firstCol = false;
sb.AppendLine("<td><a href=\"" + SPContext.Current.Web.Url + "/_layouts/listform.aspx?PageType=4&ListId={" + this._listToDisplay + "}&ID=" + item["BdcIdentity"].ToString() + "\">" + item[field].ToString() + "</a></td>");
}
else
{
sb.AppendLine("<td>" + item[field].ToString() + "</td>");
}
}
sb.AppendLine("</tr>");
}
sb.AppendLine("</table>");
writer.Write(sb.ToString());
}
else
{
writer.Write(defaultView.RenderAsHtml());
}
}
}
catch (Exception ex)
{
writer.Write(ex.ToString());
}
}
示例14: WriteLog
public static void WriteLog(string filename, string message)
{
var builder = new System.Text.StringBuilder();
builder.AppendLine("=======================" + DateTime.Now.ToString() + "=======================");
builder.AppendLine(message);
builder.AppendLine("=================================================");
System.IO.File.AppendAllText(filename, builder.ToString());
}
示例15: ToString
public override string ToString()
{
System.Text.StringBuilder builder = new System.Text.StringBuilder();
builder.AppendLine("Name: " + szPname);
builder.AppendLine("DriverVersion: " + vDriverVersion);
builder.AppendLine("Formate: " + dwFormats.ToString());
return builder.ToString();
}