问题列表 - 第30308页

DotNetOpenAuth RP在SSL设备后面失败

我无法在SSL设备后面运行DNOA RP(终止客户端HTTPS连接并将HTTP反向代理到其后面的Web服务器).

问题是,RP是错误从传入请求猜测收件人端点(因为它是不是 HTTPS被它击中了网络服务器的时间)和终点与方案上的return_to URL对比(这 HTTPS) -它失败的堆栈跟踪下面.我已经在代码中花了一些时间,如果没有自定义构建或非平凡的子类,我没有看到改变这种行为的方法.我已经将Realm和ReturnToUrl的HTTPS版本传递给OpenIdRelyingParty.CreateRequests() - 该部分工作正常.

是否有可能将检测到的收件人方案捏造为HTTPS或跳过股票DNOA版本的方案比较,或者我明天修补自定义构建?


堆栈跟踪:

ERROR DotNetOpenAuth.Messaging - 09 Jul 2010 00:11:39,450 - Protocol error: The openid.return_to parameter (https://XXX/Login.aspx?openid=XXX&dnoa.userSuppliedIdentifier=XXX) does not match the actual URL (http://XXX/Login.aspx?openid=XXX&dnoa.userSuppliedIdentifier=XXX&openid.ns=http://specs.openid.net/auth/2.0&openid.mode=id_res&openid.op_endpoint=XXX&openid.response_nonce=XXX&openid.return_to=https://XXX/Login.aspx?openid=XXX&dnoa.userSuppliedIdentifier=XXX&openid.assoc_handle=XXX&openid.signed=op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle&openid.sig=XXX&openid.identity=XXX&openid.claimed_id=XXX) the request was made with.
 at DotNetOpenAuth.Messaging.ErrorUtilities.VerifyProtocol(Boolean condition, String message, Object[] args)
 at DotNetOpenAuth.OpenId.Messages.IndirectSignedResponse.VerifyReturnToMatchesRecipient()
 at DotNetOpenAuth.OpenId.Messages.IndirectSignedResponse.EnsureValidMessage()
 at DotNetOpenAuth.Messaging.MessageSerializer.Deserialize(IDictionary`2 fields, MessageDictionary messageDictionary)
 at DotNetOpenAuth.Messaging.Reflection.MessageDictionary.Deserialize(IDictionary`2 fields)
 at DotNetOpenAuth.Messaging.Channel.Receive(Dictionary`2 fields, MessageReceivingEndpoint recipient)
 at DotNetOpenAuth.Messaging.Channel.ReadFromRequestCore(HttpRequestInfo request)
 at DotNetOpenAuth.Messaging.Channel.ReadFromRequest(HttpRequestInfo httpRequest)
 at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse(HttpRequestInfo httpRequestInfo)
 at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.GetResponse()
Run Code Online (Sandbox Code Playgroud)

ssl dotnetopenauth

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

我可以为第二个文件分配相同的文件指针吗?

function()
{
 FILE *ptr;
 ptr = fileopen(file1.txt)
 fprint(ptr, some text) //print to file 1

     if(second file needed)
     {
        ptr = fileopen(file2.txt) //open a second file, assign to same file pointer
        fprint(ptr, some text) //print to file 2  not working here? 

     }

}
Run Code Online (Sandbox Code Playgroud)

编辑:
不打印到第二个文件...但是,fprint()不返回负值.

c file-io text file

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

升级到.NET 4.0时出现<system.web.extensions>配置组问题

所以我们已经从3.5 SP1升级了我们的站点 - > .NET 4.

当我们运行该站点时,我们收到内部服务器错误(500),说明无法读取以下配置组:

<system.web.extensions>
        <scripting>
            <scriptResourceHandler enableCompression="true" enableCaching="true" />
            <webServices>
                <jsonSerialization maxJsonLength="999999" />
            </webServices>
        </scripting>
    </system.web.extensions>
Run Code Online (Sandbox Code Playgroud)

我们注释掉了这一部分并且网站运行正常(但现在我们遇到了JSON的问题 - 因为上面要求的属性).

我们已经阅读了关于这个问题的线程,并且大多数人都说"你的应用程序池没有运行4.0".它就是,所以这不是问题.

我还读过线程,说IIS正在以某种方式读取旧的machine.config文件.

使用.NET 4,您知道web.config的许多部分已移至machine.config.

所以我们把这部分放回web.config的顶部:

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
                    <section name="authenticationService" …
Run Code Online (Sandbox Code Playgroud)

asp.net deployment web-config asp.net-4.0 system.web

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

如何使这个CLR与2005年一起工作?

我正在尝试为使用.net 3.5程序集的sql 2005数据库创建一个clr存储过程

所以首先我必须改变sql 2005来识别system.core是不安全的我不太高兴(我宁愿让它说SAFE).

现在我收到了这个错误

 Msg 6522, Level 16, State 1, Procedure StoredProcedure1, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'StoredProcedure1': 
System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.

The protected resources (only available with full trust) were: All
The demanded resources were: MayLeakOnAbort

System.Security.HostProtectionException: 
   at StoredProcedures.StoredProcedure1(String UtcDateTime)
Run Code Online (Sandbox Code Playgroud)

这是我的代码

Exec StoredProcedure1 '7/8/2010 5:00:00 am'


using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;


public partial …
Run Code Online (Sandbox Code Playgroud)

c# sql clr sql-server-2005 sqlclr

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

你见过的源库最聪明的用途是什么?

这实际上源于我之前的问题,其中一个答案让我想知道人们如何以不同的方式使用scm/repository进行开发.

version-control

22
推荐指数
2
解决办法
3604
查看次数

同时检测鼠标左键和右键?

我正在重新制作windows Minesweeper(来自XP),他们所包含的内容是,如果你同时用鼠标左键单击一个带有尽可能多的旗号的数字,它会显示该数字周围的所有其他隐藏的牌.

我很难知道何时同时按下左右鼠标按钮......我正在使用一对bool,每个按钮一个,OnMouseDown和OnMouseUp事件,但如果是2个按钮在完全相同的时间(或非常接近)单击,然后只有一个MouseDown事件关闭而另一个没有...如果您单击并按住其中一个按钮然后单击并按住另一个,代码可以正常工作.

有没有更好的方法来检测这种"双重"点击?

编辑:

好吧,小故事为什么我把它搞砸了(它一直都有效).

我有一个运行Windows 7的macbook pro.对于那些不知道的人,macbook pro只有一个鼠标按钮栏,通常会留下点击,但是如果你放下2个手指就可以点击右键,这样你就可以'两者都做(并且没有中间点击).所以我正在构建我的应用程序并将其发送给我的朋友,他告诉我它不起作用,所以我发布了这个问题.我终于决定在我的另一台笔记本电脑上试用它,带有2个鼠标按键的戴尔XPS ......一旦它在那里工作,我将它传递给其他朋友,他们确认它有效.我不知道我的第一个朋友是如何搞砸了,但故事的道德是不要买任何苹果.至少那是我得到的道德.

c# mouse click mouseevent mouseclick-event

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

映射PHP脚本和文件依赖关系结构

我最近成为了一个初创公司在线课堂系统的实习生.所以现在,我正忙着学习系统,并了解用PHP编写的程序代码.该程序跨越一百多个文件夹,包含大约3000个PHP文件和相关图像,html页面,CSS文件等.

我想知道是否有一些程序或实用程序可以解析文件和目录并创建各种类型的地图,显示哪些PHP文件包含哪些其他文件,以便我可以快速查看哪些文件和脚本不再使用或过时,以及哪些文件依赖于其他文件,等等.换句话说,我可以看到文件和目录结构.我现在想看看依赖结构,包括.无需单独打开每个文件并跟踪includes语句.

任何帮助,将不胜感激!

php

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

如何用另一个对象替换__init __()中的实例?

我在ClassA中调用构造函数,并且如果满足某个条件,则希望生成的对象具有不同的类(ClassB).我试着更换的第一个参数__init __()(在下面的例子中"自我") __init __(),但它似乎并没有做我想做的.

在主要:

import ClassA

my_obj = ClassA.ClassA(500)
# unfortunately, my_obj is a ClassA, but I want a ClassB!
Run Code Online (Sandbox Code Playgroud)

在ClassA/__ init__.py中:

import ClassB

class ClassA:
    def __init__(self,theirnumber):
        if(theirnumber > 10):
            # all big numbers should be ClassB objects:
            self = ClassB.ClassB(theirnumber)
            return
        else:
            # numbers under 10 are ok in ClassA.
            return
Run Code Online (Sandbox Code Playgroud)

在ClassB/__ init__.py中:

class ClassB:
    pass
Run Code Online (Sandbox Code Playgroud)

python oop

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

重新填充CodeIgniter中的选择表单字段

我想在验证后重新填充(即重新填充)从选择表单字段发布的值.我知道使用set_select()函数提出的codeigniter用户指南,但是他们的指南中的示例假设您已经硬编码(在HTML中)'select'表单元素的值数组.在我的情况下,我使用了Form Helper,我的select字段值从数组()中拉出,如下所示:


$allstates = array('blah','blah2','blah3','blah4','blah5');
echo form_label('Select State Affiliate', 'state'); 
echo form_dropdown('state', $allstates);
Run Code Online (Sandbox Code Playgroud)

毋庸置疑,$ allstates数组是动态的,随着时间的推移而变化.那么我如何进行编码以便可以使用用户选择的值重新填充我的选择字段?

forms validation select codeigniter

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

如何确定链接实际需要哪些目标文件?

我不得不修改一些在C项目中使用的开源代码.我不想使用修改后的代码构建库,而是希望从我自己的源代码中编译和构建可执行文件,并结合修改后的开源代码.目标是拥有一个可以分发的独立包.我可以使用GNU构建工具正常工作并成功构建我的可执行文件.

现在我想减少我正在构建和链接的代码量.有没有一种简单的方法来确定我实际需要编译哪些开源文件?比方说,开源软件包中包含40个.c文件.我猜我的代码只使用(或导致使用)这些文件的20-ish.目前我正在编译所有这些并将所有内容丢给链接器.必须有一种聪明(简单?)的方法来确定我真正需要哪些,对吧?

如果它有用,我很乐意提供进一步的细节.提前致谢.

c linker compilation

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