本文整理汇总了C#中Format.Header方法的典型用法代码示例。如果您正苦于以下问题:C# Format.Header方法的具体用法?C# Format.Header怎么用?C# Format.Header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format.Header方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginProcessRequest
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
if (context == null)
throw new ArgumentNullException("context");
if (_result != null)
throw new InvalidOperationException("An asynchronous operation is already pending.");
HttpRequest request = context.Request;
NameValueCollection query = request.QueryString;
//
// Limit the download by some maximum # of records?
//
_maxDownloadCount = Math.Max(0, Convert.ToInt32(query["limit"], CultureInfo.InvariantCulture));
//
// Determine the desired output format.
//
string format = Mask.EmptyString(query["format"], "csv").ToLower(CultureInfo.InvariantCulture);
switch (format)
{
case "csv": _format = new CsvFormat(context); break;
case "jsonp": _format = new JsonPaddingFormat(context); break;
case "html-jsonp": _format = new JsonPaddingFormat(context, /* wrapped */ true); break;
default:
throw new Exception("Request log format is not supported.");
}
Debug.Assert(_format != null);
//
// Emit format header, initialize and then fetch results.
//
context.Response.BufferOutput = false;
_format.Header();
AsyncResult result = _result = new AsyncResult(extraData);
_log = ErrorLog.GetDefault(context);
_pageIndex = 0;
_lastBeatTime = DateTime.Now;
_context = context;
_callback = cb;
_errorEntryList = new ArrayList(_pageSize);
_log.BeginGetErrors(_pageIndex, _pageSize, _errorEntryList,
new AsyncCallback(GetErrorsCallback), null);
return result;
}