本文整理汇总了C#中System.Web.UI.HtmlTextWriter.GetHttpWriter方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.GetHttpWriter方法的具体用法?C# HtmlTextWriter.GetHttpWriter怎么用?C# HtmlTextWriter.GetHttpWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.GetHttpWriter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
override void Render (HtmlTextWriter writer)
{
if (length == -1) {
writer.Write (base.Text);
return;
}
HttpWriter hw = writer.GetHttpWriter ();
if (hw == null || hw.Response.ContentEncoding.CodePage != 65001) {
byte [] bytes = new byte [length];
Marshal.Copy (ptr, bytes, 0, length);
writer.Write (Encoding.UTF8.GetString (bytes));
bytes = null;
return;
}
hw.WriteUTF8Ptr (ptr, length);
}
示例2: WriteUTF8ResourceString
protected void WriteUTF8ResourceString (HtmlTextWriter output, int offset, int size, bool fAsciiOnly)
{
if (resource_data == null)
return; // throw?
if (output == null)
throw new ArgumentNullException ("output");
if (offset > resource_data.MaxOffset - size)
throw new ArgumentOutOfRangeException ("size");
//TODO: fAsciiOnly?
IntPtr ptr = AddOffset (resource_data.Ptr, offset);
HttpWriter writer = output.GetHttpWriter ();
if (writer == null || writer.Response.ContentEncoding.CodePage != 65001) {
byte [] bytes = new byte [size];
Marshal.Copy (ptr, bytes, 0, size);
output.Write (Encoding.UTF8.GetString (bytes));
bytes = null;
return;
}
writer.WriteUTF8Ptr (ptr, size);
}