我正在尝试实施Facebook Connect单点登录网站.我最初只有一个Connect按钮(<fb:login-button>),用户每次想要登录时都必须点击.我现在有自动登录和注销功能.也就是说,我的网站将检测登录的Facebook帐户,如果它可以找到我的网站的一个用户帐户匹配,则自动验证它们,如果Facebook会话丢失,则自动取消验证.我还有一个手动注销按钮,可以将用户从我的网站和Facebook中注销.所有这些都正常工作,但现在我的原始Connect按钮间歇性地无法正确呈现.它只是显示为普通的XHTML(即,它看起来像纯文本 - 不是按钮 - 并且是不可点击的),并且没有应用XFBML.这是基本代码:
在每个页面上:
<body>
{...}
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript>
FB.init('APIKey', '/xd_receiver.htm');
var isAuth; // isAuth determines if the user is authenticated on my site
// it should be true on the logout page, false on the login page
FB.ensureInit(function(){
var session = FB.Facebook.apiClient.get_session();
if (session && !isAuth) {
PageMethods.FacebookLogin(session.uid, session.session_key, FBLogin, FBLoginFail);
// This is an AJAX call that authenticates the user on my site.
} else if(!session && isFBAuth) {
PageMethods.FacebookLogout(FBLogout, FBLogoutFail); …Run Code Online (Sandbox Code Playgroud) 是否有一个简单的算法来加密整数?也就是说,函数E(i,k)接受n位整数和密钥(任何类型)并产生另一个不相关的n位整数,当它被馈入第二函数D(E(i)时, k)(连同键)产生原始整数?
显然,您可以执行一些简单的可逆操作,但它们似乎都产生了明显相关的输出(例如,连续输入会导致连续输出).当然,还有加密强大的标准算法,但它们不能产生足够小的输出(例如32位).我知道任何32位加密技术都可能是强制性的,但我并不是在寻找加密强大的东西,只是看起来像是随机的东西.从理论上讲,它应该是可能的; 毕竟,我可以通过随机配对每个整数来创建一个字典.但是我希望能有一点内存密集的东西.
编辑:谢谢你的回答.简单的XOR解决方案不起作用,因为类似的输入将产生类似的输出.
我正在尝试调试ASP.Net 3.5应用程序中的错误.我们最近将应用程序从IIS6移到了7.在IIS6中,代码如下:
Throw new Exception("My message")
Run Code Online (Sandbox Code Playgroud)
将显示一个页面,提供错误消息,附近的代码行和堆栈跟踪(使用"debug"编译模式,没有自定义错误).
在IIS7中,"详细"错误消息仅提供模块和错误代码:
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Detailed Error Information
Module global.asax
Notification BeginRequest
Handler StaticFile
Error Code 0x00000000
Requested URL [My URL]
Physical Path [My Path]
Logon Method Not yet determined
Logon User Not yet determined
Failed Request Tracing Log Directory [My Directory]
Run Code Online (Sandbox Code Playgroud)
我甚至设置了失败请求跟踪,它声称提供堆栈跟踪,但仍然没有给我任何行号或错误消息,只有模块名称和HTTP状态.
No. 111.
Severity Warning
Event -MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName global.asax
Notification 1
HttpStatus 500
HttpReason Internal Server …Run Code Online (Sandbox Code Playgroud) asp.net ×2
ajax ×1
algorithm ×1
cryptography ×1
debugging ×1
facebook ×1
iis-7 ×1
javascript ×1