小编Jon*_*ill的帖子

VS到Azure发布失败:套接字错误10054

我已经看到了一些关于此的帖子,没有一个解决了我的问题.

我正在尝试完成Web部署到Azure站点,但在更新文件时,我收到警告:

MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4270,5) Warning : Retrying the sync because a socket error (10054) occurred Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 1 of 10.

在Web发布向导中,可以成功验证连接.

我在某处看到我应该启用不受信任的证书,但是我无法在VS2013的Web部署设置中看到此选项.

重要笔记:

  • 我可以部署其他项目(所以我认为这不是防火墙问题).
  • 我的同事可以使用旧版本的项目执行Web部署(因此Azure工作正常).
  • 我无法使用相同的旧版本项目执行Web部署.

它也不适用于FTP发布,虽然它没有给我套接字错误警告.会是什么呢?

JK

sockets asp.net webdeploy azure-web-sites visual-studio-2013

11
推荐指数
2
解决办法
1万
查看次数

JS切换可见性并更改其他项目的CSS

我确信这非常简单,但我对JS很新,我想知道这样做的最好方法,而不是通过解决方法来解决它.

所以我有一个div块,当按下它上方的文本字段时,它的可见性就会被切换.

<h3 onclick="javascript: toggle1();">
  <span style="cursor:pointer">
    <b>Text1</b>
  </span>
</h3>

<div id="Text1" hidden="hidden">blahblah</div>
Run Code Online (Sandbox Code Playgroud)

然后我有我的JS:

function toggle1() {
  $('#Text1').toggle(1000);
}
Run Code Online (Sandbox Code Playgroud)

这工作正常,但是当用户单击标题文本时,我还想更改其<hr>上方元素的高度

<hr id="line1" style="height:2px;border:none;color:#03930f;background-color:#03930f;" />
Run Code Online (Sandbox Code Playgroud)

我试过添加:

if($('#Text1').is(':visible')) {
  document.getElementById("line1").style.height = "15px";
}
else { 
  document.getElementById("line1").style.height = "2px"; 
}
Run Code Online (Sandbox Code Playgroud)

但这不起作用...我假设因为toggle()函数没有切换is(':visible')条件检查的相同的东西.

这样做的正确方法是什么?

html javascript css jquery

6
推荐指数
1
解决办法
305
查看次数

ADAL.js-使用id_token获取Microsoft Graph Access令牌

我正在尝试将Azure AD登录和Graph API集成到我的angular2网站中。

我已经成功实现了ADAL登录和重定向,它是围绕此处的一个有用的博客文章构建的

从中,我检索了adalservice可以访问的id_token参数。当前,这是通过简单的context.login()并在重定向中捕获令牌来实现的。

当我使用此令牌尝试访问Microsoft Graph时,收到InvalidAuthenticationToken响应,指出Access Token validation failure

具有获得的“ access_token”的API调用

我是新手,因此可能是我的电话本来是错误的,或者我在AD中缺少某些权限,或者我的应用程序注册表缺少权限。我已经看到我可能需要请求具有足够范围的访问令牌,但是我可以找到任何此类示例。

有没有人使用此adalService库获取用于Graph API的令牌?

azure-active-directory adal adal.js microsoft-graph

5
推荐指数
1
解决办法
4097
查看次数

SQL查询 - 从datetime字段开始的平均时间

我正在努力解决我认为简单的SQL查询问题.运行SQL Server 2014

我有一个SQL表,"访问":

Id | EntryTime | Duration
Run Code Online (Sandbox Code Playgroud)

我想找到两个日期之间的平均入场时间,同时考虑这些日期之间的所有记录.

所以,如果我的EntryTime日期之间的字段是:

2016-04-28 12:00:00
2016-04-20 10:00:00
2016-04-19 08:00:00
2016-04-17 10:00:00
Run Code Online (Sandbox Code Playgroud)

那么返回的平均时间应该是:

10:00:00
Run Code Online (Sandbox Code Playgroud)

根本不应该考虑日期,它应该以字符串格式或仅返回的方式返回10:00:00.

sql-server datetime

3
推荐指数
1
解决办法
8620
查看次数

从文件中裁剪图像并在 C# 中重新保存

以前从未真正使用过图形。我环顾四周,并从解决我问题的一小部分的答案中拼凑出一些解决方案。但都没有奏效。

我想从文件中加载图像,该图像的大小始终为 320x240。然后我想将其裁剪以获得 240x240 的图像,并修剪每侧外部 40px。完成此操作后,我想另存为新图像。

    private void croptoSquare(string date)
    {
        //Location of 320x240 image
        string fileName = Server.MapPath("~/Content/images/" + date + "contactimage.jpg");

        //New rectangle of final size (I think maybe Point is where I would eventually specify where the crop square site i.e. (40, 0))
        Rectangle cropRect = new Rectangle(new Point(0, 0), new Size(240, 240));
        //Create a Bitmap with correct height/width.
        Bitmap target = new Bitmap(cropRect.Width, cropRect.Height);

        //Load image from file
        using (Image image = Image.FromFile(fileName))
        {
            //Create Graphics …
Run Code Online (Sandbox Code Playgroud)

c# graphics image

1
推荐指数
1
解决办法
5029
查看次数