本文整理汇总了C#中IHttpContext.WriteEmbeddedFile方法的典型用法代码示例。如果您正苦于以下问题:C# IHttpContext.WriteEmbeddedFile方法的具体用法?C# IHttpContext.WriteEmbeddedFile怎么用?C# IHttpContext.WriteEmbeddedFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHttpContext
的用法示例。
在下文中一共展示了IHttpContext.WriteEmbeddedFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Respond
public override void Respond(IHttpContext context)
{
if (context.Request.Url.AbsolutePath == RavenRoot.RootPath &&
SilverlightUI.GetPaths(ResourceStore.SilverlightXapName, ResourceStore.Configuration.WebDir).All(f => File.Exists(f) == false))
{
context.WriteEmbeddedFile(ResourceStore.GetType().Assembly, Settings.WebDir, "studio_not_found.html");
return;
}
var docPath = context.GetRequestUrl().Replace("/raven/", "");
context.WriteEmbeddedFile(ResourceStore.GetType().Assembly,Settings.WebDir, docPath);
}
示例2: Respond
public override void Respond(IHttpContext context)
{
Database.ExtensionsState.GetOrAdd("SilverlightUI.NotifiedAboutSilverlightBeingRequested", s =>
{
foreach (var silverlightRequestedAware in SilverlightRequestedAware)
{
silverlightRequestedAware.Value.SilverlightWasRequested(Database);
}
return true;
});
var match = urlMatcher.Match(context.GetRequestUrl());
var fileName = match.Groups[1].Value;
var paths = GetPaths(fileName, Database.Configuration.WebDir);
var matchingPath = paths.FirstOrDefault(path =>
{
try
{
return File.Exists(path);
}
catch (Exception)
{
return false;
}
});
if (matchingPath != null)
{
context.WriteFile(matchingPath);
return;
}
context.WriteEmbeddedFile(Settings.WebDir, "Raven.Studio.xap");
}
示例3: Respond
public override void Respond(IHttpContext context)
{
if (string.IsNullOrEmpty(Database.Configuration.RedirectStudioUrl) == false)
{
context.Response.Redirect(Database.Configuration.RedirectStudioUrl);
return;
}
var docPath = context.GetRequestUrl().Replace("/raven/", "");
context.WriteEmbeddedFile(Settings.WebDir, docPath);
}
示例4: Respond
public override void Respond(IHttpContext context)
{
var docPath = context.GetRequestUrl().Replace("/raven/", "");
context.WriteEmbeddedFile(ResourceStore.GetType().Assembly,Settings.WebDir, docPath);
}
示例5: Respond
public override void Respond(IHttpContext context)
{
context.WriteEmbeddedFile(Settings.WebDir, "favicon.ico");
}
示例6: Respond
public override void Respond(IHttpContext context)
{
context.WriteEmbeddedFile(ResourceStore.GetType().Assembly, Settings.WebDir, "favicon.ico");
}
示例7: Respond
public override void Respond(IHttpContext context)
{
var docPath = context.GetRequestUrl().Replace("/studio/", "");
if(string.IsNullOrEmpty(docPath)) docPath = "studio.html";
context.WriteEmbeddedFile(ResourceStore.GetType().Assembly, Settings.WebDir, docPath);
}