我定义了一个 WebApi,它从浏览器获取凭据,它可以工作。部署后,我必须将服务器上的身份验证从 编辑Anonymouns为Windows。我尝试添加<authentication mode="Windows"/>到 Web.Config.Release 但它没有改变...为什么?建议?
我正在尝试将 div(屏幕中心)居中。这div不是 的直接子代,body所以我不能使用 css。目前,我使用以下 jQuery 代码将它放在我的页面上:
var dialog = $('#MyDialog');
dialog.css('left', ($('body').width()/2) - (dialog.width()/2));
dialog.css('top', ($('body').height()/2) - (dialog.height()/2);
Run Code Online (Sandbox Code Playgroud)
目标是删除 jQuery,我已经写过这个:
var showDialog = function(){
var body = document.body;
var html = document.documentElement;
var bodyHeight = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
var bodyWidth = Math.max( body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth );
var dialogWidth = 800;
var dialogHeight = 560;
var dialog = document.getElementById('MyDialog');
dialog.style.left = (bodyWidth/2) - (dialogWidth/2) + 'px';
dialog.style.top = (bodyHeight/2) - (dialogHeight/2) …Run Code Online (Sandbox Code Playgroud) documents是IDictionary<string, string>参数的位置<filename, fileUrl>
DocumentHandler.Download() 返回一个 Task<Memorystram>
此代码有效:
foreach (var x in documents.Keys)
{
var result = await DocumentHandler.Download(new Uri(documents[x]));
// other code
}
Run Code Online (Sandbox Code Playgroud)
然而它同步发展.
为了运行它所有async我写了这段代码:
var keys =
documents.Keys.Select(async x =>
{
return Tuple.Create(x, await DocumentHandler.Download(new Uri(documents[x])));
});
await Task.WhenAll(keys);
foreach (var item in keys)
{
var tpl = item.Result;
// other code
}
Run Code Online (Sandbox Code Playgroud)
它不起作用,它崩溃而没有在最后一行显示异常var tpl = item.Result;为什么?
今天我发现--no-edit了--amend.但是,它引出了以下问题.这里的步骤:
git push origin master
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://me@bitbucket.org/myRepo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)为什么?
注意:我是唯一一个处理该回购的人.
c# ×2
async-await ×1
asynchronous ×1
exception ×1
git ×1
git-amend ×1
height ×1
html ×1
javascript ×1
push ×1
width ×1