在我的MVC 5 Web应用程序中,我有这个(在AccountController.cs中):
// Used for XSRF protection when adding external sign ins
private const string XsrfKey = "XsrfId";
Run Code Online (Sandbox Code Playgroud)
和
public string SocialAccountProvider { get; set; }
public string RedirectUri { get; set; }
public string UserId { get; set; }
public override void ExecuteResult(ControllerContext context)
{
var properties = new AuthenticationProperties { RedirectUri = RedirectUri };
if (UserId != null)
{
properties.Dictionary[XsrfKey] = UserId;
}
context.HttpContext.GetOwinContext().Authentication.Challenge(properties, SocialAccountProvider);
}
Run Code Online (Sandbox Code Playgroud)
它究竟是如何用于保护的?
我应该将XsrfKey的值设置为更随机的值吗?
是否可以向Azure虚拟机添加"自定义"大小的内存?
例如,我使用的是中型 - 2核,4GB内存,我想拥有8GB内存和我当前的设置......否则下一个选项是A5 2内核,14GB.
我试图理解为什么新的ASP.NET身份表停止使用Guid(uniqueidentifier类型)作为键 - 相反它现在正在使用nvarchar(128)但仍保持Guid一个string...
这不是一个巨大的浪费吗?(uniqueidentifier只有2 integers对整体Guid作为36个字符string)
我怀疑实体框架可能对此负责......
更改为uniqueidentifier键是否安全?
谁能告诉我使用36个字符串有什么好处?
asp.net entity-framework entity-framework-6 asp.net-identity
我在我的网站上添加了Google广告,每隔几分钟就开始播放一个视频广告,这样就可以了,只有声音不合适,有没有办法关闭这些广告的声音 - 服务器端?
我正在查看 FontAwesome path.less ,看起来它正在加载一堆相同的字体但类型不同......
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'),
url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
// src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
我真的需要为 FontAwesome 加载所有这些字体类型还是只需要 WOFF2 类型?
看起来Facebook在过去几天发生了变化,我注意到这篇文章:作者信息不再出现了(文章:出版商仍然有效)
https://developers.facebook.com/docs/reference/opengraph/object-type/article
它曾经像这样正常工作:
<meta property="article:author" content="https://www.facebook.com/yovav"/>
Run Code Online (Sandbox Code Playgroud)
例如,如果您在Facebook上分享https://ufotoday.com/post/10061,则应显示作者.
更新2 现在正在运行,我在公司下添加了我的Facebook网站页面后,我在链接出版物中添加了确认出版物,并将公司页面更新为"新闻和媒体网站·出版商".
更新1:所以链接出版物在用户配置文件设置中找到(而不是在公司的Facebook页面设置中),首先我在facebook自动完成列表中找不到网站,我将页面模板更改为"business"并设置"News&Media"网站","发布者"类别.现在它被添加为确认出版物.
我的元数据现在具有以下值:
<meta property="article:author" content="https://facebook.com/yovav" />
<meta property="article:publisher" content="https://www.facebook.com/1677453589249352" />
Run Code Online (Sandbox Code Playgroud)
但是,我仍然无法在发布商网站旁边看到作者姓名(在facebook帖子的左下角),我在这里缺少什么?
我正在尝试添加在 Azure DevOps 网站中查看 Mark Down 样式或以某种方式注入 CSS 的功能,
例如:当导航到 Repos 时,我有 README.md,我希望它看起来像 Microsoft 标准 MD 文档、[!TIP]、[!WARNING],而其他样式似乎不支持开箱即用。
有什么建议么?甚至可能为 Azure DevOps 网站创建一个插件(我该怎么做?)
这是我希望它看起来像这样的示例:
我创建了一些 CSS 来处理段落中的第一个字母,看起来也更大,
我怎样才能让第一个字母向下和向左推,这样它就不会高于行本身,并在需要时将其他行缩进右边?(见附图)
.text-article {
color: #000;
}
.text-article:first-letter {
font-weight: bold;
font-size: 60px;
font-size: 6rem;
line-height: 10px;
line-height: 1rem;
text-transform: uppercase;
}Run Code Online (Sandbox Code Playgroud)
<div class="text-article">
We the People is a section of the whitehouse.gov website, launched September 22, 2011,[1] for petitioning the current administration's policy experts. Petitions that meet a certain threshold of signatures are most of the time reviewed by officials in the Administration and official responses are then issued, but not always, as outlined in the Criticism …Run Code Online (Sandbox Code Playgroud)我之前从未使用过Azure PowerShell,但现在我正在运行一个命令让Azure保留一个静态IP地址:
New-AzureReservedIP -ReservedIPName"137.117.11.18"-Label"people-dns-ip"-Location"US West"
然后我收到此错误:New-AzureReservedIP:未指定默认订阅.
所以,我试图找出什么是或只是设置为默认...使用命令Select-AzureSubscription我可以看到订阅名称BizSpark不存在.
不知道如何在屏幕上打印Get-AzureSubscription的值,但在我的Azure门户中说:SUBSCRIPTION NAME BizSpark
知道如何解决这个问题吗?或者这个选项仅限于BizSpark用户?
我错过了什么?
我正在尝试使用像这样的TransactionScope读取NOLOCK:
var scopeOptions = new TransactionOptions { IsolationLevel = IsolationLevel.ReadUncommitted };
using (var scope = new TransactionScope(TransactionScopeOption.Required, scopeOptions))
{
using (var db = new MyDbContext(ConnectionStringEntities))
{
// Simple read with a try catch block...
}
scope.Complete();
}
Run Code Online (Sandbox Code Playgroud)
我希望看到NOLOCK添加到SQL查询中(查看SQL Profiler以及自定义DbCommandInterceptor - 但它不存在...
更新:经过一些更多的研究,我想知道所选的光标是否正在被使用,只是没有NOLOCK"提示"(特定于SQL Server - 并且还特定于一个表),我找到了一些代码来获取当前事务和它似乎显示正确选择的事务隔离(ReadUncommitted/Serializable等)我仍然想测试它,但如果你有任何想法让我知道
获取当前的.net TransactionScope IsolationLevel
Transaction trans = Transaction.Current;
System.Transactions.IsolationLevel level = trans.IsolationLevel;
LogService.Instance.Debug($"Transaction IsolationLevel = {level.ToString()}");
Run Code Online (Sandbox Code Playgroud) 我的正则表达式可能有些错误(可能它循环太多)我认为这会导致MVC(C#)Web应用程序超时...
regEx是:
public const string UrlPartPost = @"^([0-9a-zA-Z-/]*){1,256}$";
Run Code Online (Sandbox Code Playgroud)
我这样使用它:
Regex.Match(urlPart3, RegExKeys.UrlPartPost, RegexOptions.IgnoreCase).Success
Run Code Online (Sandbox Code Playgroud)
我添加了一个实时测试 - 这也是暂时的:https: //regex101.com/r/vZ0lN5/1
这很好:test1-test2-test3-test4-test5
这次超时:test1-test2-test3-test4-test_5
我怎样才能修复它以便它不会超时?
更新: 什么是"*"应该做的确切?
我想在我的Facebook应用程序上使用"需要应用程序秘密"(需要应用程序秘密进行服务器API调用),但如果我这样做 - 我收到以下错误:
(GraphMethodException - #100)未指定appsecret_proof参数
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:Facebook.FacebookApiException:(GraphMethodException - #100)未指定appsecret_proof参数
来源错误:
第801行:var fb = new FacebookClient(accessToken); 第802行:第803行: 动态facebookInfo = fb.Get("/ me?appsecret_proof ="+ fb.AppSecret +"&fields = email,birthday,gender"); 第804行:signInInfo.Email = facebookInfo.email; 805行:
我看到这篇文章,所以我想了解如何发送它...我需要切换到fb.Post吗?
另外,我想知道SDK是否还没有类似"GenereateFaceBookSecret()"的东西
提前致谢.