本文整理汇总了C#中System.Web.HttpContext.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# HttpContext.GetType方法的具体用法?C# HttpContext.GetType怎么用?C# HttpContext.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.HttpContext
的用法示例。
在下文中一共展示了HttpContext.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
public void ProcessRequest(HttpContext context)
{
HttpPostedFile uploads = context.Request.Files["upload"];
string CKEditorFuncNum = context.Request["CKEditorFuncNum"];
string file = System.IO.Path.GetFileName(uploads.FileName);
uploads.SaveAs(context.Server.MapPath(".") + "\\artimg\\" + file);
string url = "/Admin/artimg/" + file;
string a = context.GetType().ToString();
context.Response.Write("<script>window.parent.CKEDITOR.tools.callFunction(" + CKEditorFuncNum + ", \"" + url + "\");</script>");
context.Response.End();
}
示例2: GetWorkerRequest
//[SecurityPermission(SecurityAction.Assert, UnmanagedCode = true)]
HttpWorkerRequest GetWorkerRequest(HttpContext context)
{
if (_hasUnmanagedCodePermission)
{
IServiceProvider provider = (IServiceProvider)context;
return (HttpWorkerRequest)provider.GetService(typeof(HttpWorkerRequest));
}
else
{
Type c = context.GetType();
PropertyInfo p = c.GetProperty("WorkerRequest", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
if (p != null)
return (HttpWorkerRequest)p.GetValue(context, null);
else
return null;
}
}