本文整理汇总了C#中IHttpResponse.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# IHttpResponse.WriteLine方法的具体用法?C# IHttpResponse.WriteLine怎么用?C# IHttpResponse.WriteLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHttpResponse
的用法示例。
在下文中一共展示了IHttpResponse.WriteLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteNavigation
private void WriteNavigation(IHttpResponse response)
{
response.WriteLine ("<h2>Tutorial</h2>");
response.WriteLine ("<ul>");
for (int i = 0; i < tutorial_pages.Count; i++) {
response.WriteLine ("<li><a href='/Tutorial/page-{0}.md'>{1}</a></li>", i + 1, tutorial_pages [i]);
}
response.WriteLine ("</ul>");
response.WriteLine ("<h2>Manuals</h2>");
response.WriteLine ("<ul>");
foreach (string manual in manuals.Keys) {
response.WriteLine ("<li><a href='/Manuals/{0}'>{0}</a></li>", manual);
}
response.WriteLine ("</ul>");
}
示例2: WriteNavigation
private void WriteNavigation(IHttpResponse response)
{
response.WriteLine ("<h2>Tutorial</h2>");
response.WriteLine ("<ul>");
foreach (string tutorial in tutorial_pages.Keys) {
response.WriteLine ("<li><a href='/Tutorial/{0}'>{0}</a></li>", tutorial);
}
response.WriteLine ("</ul>");
response.WriteLine ("<h2>Manuals</h2>");
response.WriteLine ("<ul>");
foreach (string manual in manuals.Keys) {
response.WriteLine ("<li><a href='/Manuals/{0}'>{0}</a></li>", manual);
}
response.WriteLine ("</ul>");
}
示例3: RenderLocation
public static void RenderLocation(IHttpResponse r, string file, int line)
{
if (file == null)
return;
// Does the file exist?
if (System.IO.File.Exists(file))
{
try
{
var rdr = new StreamReader(file);
var sb = new StringBuilder();
r.Write("<pre>");
for (int i = 1; ; i++)
{
if (i > line + 2)
break;
var text = rdr.ReadLine();
if (text == null)
break;
if (i < line - 2)
continue;
if (i == line)
r.Write("<span style=\"color:red;\">");
r.Write("Line {0:0000}: ", i);
r.WriteLine(UnsafeString.Escape(text));
if (i == line)
r.Write("</span>");
}
r.WriteLine("</pre>");
}
catch (Exception)
{
// Ignore
}
}
r.Write("<p><b>Location:</b> {0} <b>Line:</b> {1}</p>\n", UnsafeString.Escape(file), line);
}